Convert between key-strings and key-codes. Also provides functionality 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. |
| Source | extensions/keycodes/init.lua |
| Signature | hs.keycodes.currentLayout() -> string |
|---|---|
| Type | Function |
| Description | Gets the name of the current keyboard layout |
| Parameters |
|
| Returns |
|
| Source | extensions/keycodes/internal.m |
| Signature | hs.keycodes.currentLayoutIcon() -> hs.image object |
|---|---|
| Type | Function |
| Description | Gets the icon of the current keyboard layout |
| Parameters |
|
| Returns |
|
| Source | extensions/keycodes/internal.m |
| Signature | hs.keycodes.currentMethod() -> string |
|---|---|
| Type | Function |
| Description | Get current input method |
| Parameters |
|
| Returns |
|
| Source | extensions/keycodes/internal.m |
| Signature | hs.keycodes.currentSourceID([sourceID]) -> string | boolean |
|---|---|
| Type | Function |
| Description | Get or set the source id for the keyboard input source |
| Parameters |
|
| Returns |
|
| Source | extensions/keycodes/internal.m |
| 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 |
|
| Source | extensions/keycodes/internal.m |
| 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 |
|
| Source | extensions/keycodes/init.lua |
| 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 |
|
| Source | extensions/keycodes/internal.m |
| 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 |
|
| Source | extensions/keycodes/internal.m |
| Signature | hs.keycodes.setLayout(layoutName) -> boolean |
|---|---|
| Type | Function |
| Description | Changes the system keyboard layout |
| Parameters |
|
| Returns |
|
| Source | extensions/keycodes/internal.m |
| Signature | hs.keycodes.setMethod(methodName) -> boolean |
|---|---|
| Type | Function |
| Description | Changes the system input method |
| Parameters |
|
| Returns |
|
| Source | extensions/keycodes/internal.m |