Convert between key-strings and key-codes. Also provides funcionality for querying and changing keyboard layouts.
Signature | hs.keycodes.map |
---|---|
Type | Constant |
Description | A mapping from string representation of a key to its keycode, and vice versa. For example: keycodes[1] == "s", and keycodes["s"] == 1, and so on. This is primarily used by the hs.eventtap and hs.hotkey extensions. Valid strings are any single-character string, or any of the following strings:
|
Signature | hs.keycodes.currentLayout() -> string |
---|---|
Type | Function |
Description | Gets the name of the current keyboard layout Parameters:
Returns:
|
Signature | hs.keycodes.currentLayoutIcon() -> hs.image object |
---|---|
Type | Function |
Description | Gets the icon of the current keyboard layout Parameters:
Returns:
|
Signature | hs.keycodes.currentMethod() -> string |
---|---|
Type | Function |
Description | Get current input method Parameters:
Returns:
|
Signature | hs.keycodes.currentSourceID([sourceID]) -> string | boolean |
---|---|
Type | Function |
Description | Get or set the source id for the keyboard input source Parameters:
Returns:
|
Signature | hs.keycodes.iconForLayoutOrMethod(sourceName) -> hs.image object |
---|---|
Type | Function |
Description | Gets an hs.image object for a given keyboard layout or input method Parameters:
Returns:
Notes:
|
Signature | hs.keycodes.inputSourceChanged(fn) |
---|---|
Type | Function |
Description | Sets the function to be called when your input source (i.e. qwerty, dvorak, colemac) changes. Parameters:
Returns:
Notes:
|
Signature | hs.keycodes.layouts([sourceID]) -> table |
---|---|
Type | Function |
Description | Gets all of the enabled keyboard layouts that the keyboard input source can be switched to Parameters:
Returns:
Notes:
|
Signature | hs.keycodes.methods([sourceID]) -> table |
---|---|
Type | Function |
Description | Gets all of the enabled input methods that the keyboard input source can be switched to Parameters:
Returns:
Notes:
|
Signature | hs.keycodes.setLayout(layoutName) -> boolean |
---|---|
Type | Function |
Description | Changes the system keyboard layout Parameters:
Returns:
|
Signature | hs.keycodes.setMethod(methodName) -> boolean |
---|---|
Type | Function |
Description | Changes the system input method Parameters:
Returns:
|