From a0879ea29c88e0f50b69ba67ba533ad42dbb288f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carsten=20Blu=CC=88m?= Date: Sun, 3 Nov 2013 15:33:46 +0100 Subject: [PATCH] Add more hardware-independent key codes --- Actions/KeyDownUpBaseAction.m | 10 ++++++---- Actions/KeyPressAction.m | 32 ++++++++++++++++++++++++++++++++ README.markdown | 13 +++++++++---- 3 files changed, 47 insertions(+), 8 deletions(-) diff --git a/Actions/KeyDownUpBaseAction.m b/Actions/KeyDownUpBaseAction.m index 83e6ef8..a2dfb4a 100644 --- a/Actions/KeyDownUpBaseAction.m +++ b/Actions/KeyDownUpBaseAction.m @@ -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 diff --git a/Actions/KeyPressAction.m b/Actions/KeyPressAction.m index 7c67462..ee105d7 100644 --- a/Actions/KeyPressAction.m +++ b/Actions/KeyPressAction.m @@ -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]; } diff --git a/README.markdown b/README.markdown index 9ac6586..b1ed6a5 100644 --- a/README.markdown +++ b/README.markdown @@ -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) @@ -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.