Skip to content

Commit

Permalink
Add more hardware-independent key codes
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueM committed Nov 3, 2013
1 parent 1136e71 commit a0879ea
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 8 deletions.
10 changes: 6 additions & 4 deletions Actions/KeyDownUpBaseAction.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ @implementation KeyDownUpBaseAction

+(NSDictionary *)getSupportedKeycodes {
return [NSDictionary dictionaryWithObjectsAndKeys:
@"59", @"ctrl",
@"55", @"cmd",
@"58", @"alt",
nil];
@"59", @"ctrl",
@"55", @"cmd",
@"58", @"alt",
@"56", @"shift",
@"63", @"fn",
nil];
}

@end
32 changes: 32 additions & 0 deletions Actions/KeyPressAction.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,38 @@ +(NSDictionary *)getSupportedKeycodes {
return [NSDictionary dictionaryWithObjectsAndKeys:
@"36", @"return",
@"53", @"esc",
@"48", @"tab",
@"49", @"space",
@"51", @"delete",
@"117", @"fwd-delete",
@"122", @"f1",
@"120", @"f2",
@"99", @"f3",
@"118", @"f4",
@"96", @"f5",
@"97", @"f6",
@"98", @"f7",
@"100", @"f8",
@"101", @"f9",
@"109", @"f10",
@"103", @"f11",
@"111", @"f12",
@"105", @"f13",
@"107", @"f14",
@"113", @"f15",
@"106", @"f16",
@"126", @"arrow-up",
@"125", @"arrow-down",
@"123", @"arrow-left",
@"124", @"arrow-right",
@"115", @"home",
@"119", @"end",
@"116", @"page-up",
@"121", @"page-down",
@"74", @"mute",
@"72", @"volume-up",
@"73", @"volume-down",
@"114", @"help",
nil];
}

Expand Down
13 changes: 9 additions & 4 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,15 @@ To get a quick first impression, this is what you will get when you invoke `clic
you may also use “.”, which means: the current position.

kd:keys Will trigger a KEY DOWN event for a comma-separated list of
modifier keys (“cmd”, “alt” or “ctrl”).
modifier keys. Possible keys are:
“alt”, “cmd”, “ctrl”, “fn”, “shift”
Example: “kd:cmd,alt” will press the command key and the
option key (and will keep them down until you release them
with another command)

ku:keys Will trigger a KEY UP event for a comma-separated list of
modifier keys (“cmd”, “alt” or “ctrl”).
modifier keys. Possible keys are:
“alt”, “cmd”, “ctrl”, “fn”, “shift”
Example: “ku:cmd,ctrl” will release the command key and the
control key (which will only have an effect if you performed
a “key down” before)
Expand All @@ -96,8 +98,11 @@ To get a quick first impression, this is what you will get when you invoke `clic
w:ms Will WAIT/PAUSE for the given number of milliseconds.
Example: “w:500” will pause command execution for half a second

kp:key Will emulate PRESSING A KEY (key down + key up). For the moment,
only “return” or “esc” can be used as key.
kp:key Will emulate PRESSING A KEY (key down + key up). Possible keys are:
“arrow-down”, “arrow-left”, “arrow-right”, “arrow-up”, “delete”, “end”,
“esc”, “f1”, “f2”, “f3”, “f4”, “f5”, “f6”, “f7”, “f8”, “f9”, “f10”, “f11”,
“f12”, “f13”, “f14”, “f15”, “f16”, “fwd-delete”, “help”, “home”, “mute”,
“page-down”, “page-up”, “return”, “space”, “tab”, “volume-down”, “volume-up”
Example: “kp:return” will hit the return key.


Expand Down

0 comments on commit a0879ea

Please sign in to comment.