I know Keyboard Maestro can create "Set Keyboard Layout" Action, such as pressing shift+control+J to switch to Japanese input method, but I want to achieve pressing the same shortcut key to switch two specific input methods, such as pressing caps (F19)* key to switch between English and Japanese, how to achieve this?
*: I have installed Karabiner-Elements and map F19 key to caps key
PS to get a localizedName property for the active keyboard layout, as well as (or instead of) an inputSourceID, you can obtain a JSON variable with the variant code below (in a JXA action), and extract the value of the key you want using Keyboard Maestro's JSONValue token.