Skip to content

Commit

Permalink
Fix for #1662: Cocoa port ignores NSNumericKeypadMask for arrow keys,
Browse files Browse the repository at this point in the history
plus updates to pref.prf to respect new keymap/keyset conventions for A:
lines (specifically, the running section).
(cherry picked from commit 4be2349d385c538ed3c95b6822f32c5b220daace)
  • Loading branch information
myshkin authored and magnate committed Jul 13, 2012
1 parent 1384cc7 commit 177135a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 20 deletions.
40 changes: 24 additions & 16 deletions lib/pref/pref.prf
Expand Up @@ -122,59 +122,67 @@ C:1:{MK}[PageUp]
# Running
A:.1
C:0:{S}[End]
C:1:{S}[End]
C:0:{SK}1
C:1:{SK}1
C:0:{SMK}[End]
A:,1
C:1:{S}[End]
C:1:{SK}1
C:1:{SMK}[End]
A:.2
C:0:{S}[Down]
C:1:{S}[Down]
C:0:{SK}2
C:1:{SK}2
C:0:{SMK}[Down]
A:,2
C:1:{S}[Down]
C:1:{SK}2
C:1:{SMK}[Down]
A:.3
C:0:{S}[PageDown]
C:1:{S}[PageDown]
C:0:{SK}3
C:1:{SK}3
C:0:{SMK}[PageDown]
A:,3
C:1:{S}[PageDown]
C:1:{SK}3
C:1:{SMK}[PageDown]
A:.4
C:0:{S}[Left]
C:1:{S}[Left]
C:0:{SK}4
C:1:{SK}4
C:0:{SMK}[Left]
A:,4
C:1:{S}[Left]
C:1:{SK}4
C:1:{SMK}[Left]
A:.6
C:0:{S}[Right]
C:1:{S}[Right]
C:0:{SK}6
C:1:{SK}6
C:0:{SMK}[Right]
A:,6
C:1:{S}[Right]
C:1:{SK}6
C:1:{SMK}[Right]
A:.7
C:0:{S}[Home]
C:1:{S}[Home]
C:0:{SK}7
C:1:{SK}7
C:0:{SMK}[Home]
A:,7
C:1:{S}[Home]
C:1:{SK}7
C:1:{SMK}[Home]
A:.8
C:0:{S}[Up]
C:1:{S}[Up]
C:0:{SK}8
C:1:{SK}8
C:0:{SMK}[Up]
A:,8
C:1:{S}[Up]
C:1:{SK}8
C:1:{SMK}[Up]
A:.9
C:0:{S}[PageUp]
C:1:{S}[PageUp]
C:0:{SK}9
C:1:{SK}9
C:0:{SMK}[PageUp]
A:,9
C:1:{S}[PageUp]
C:1:{SK}9
C:1:{SMK}[PageUp]

# Tunneling
Expand Down
11 changes: 7 additions & 4 deletions src/main-cocoa.m
Expand Up @@ -2392,10 +2392,13 @@ static BOOL send_event(NSEvent *event)
unichar c = [[event characters] characterAtIndex:0];
keycode_t ch;
switch (c) {
case NSUpArrowFunctionKey: ch = ARROW_UP; break;
case NSDownArrowFunctionKey: ch = ARROW_DOWN; break;
case NSLeftArrowFunctionKey: ch = ARROW_LEFT; break;
case NSRightArrowFunctionKey: ch = ARROW_RIGHT; break;
/* Note that NSNumericPadKeyMask is set if any of the arrow
* keys are pressed. We don't want KC_MOD_KEYPAD set for
* those. See #1662 for more details. */
case NSUpArrowFunctionKey: ch = ARROW_UP; kp = 0; break;
case NSDownArrowFunctionKey: ch = ARROW_DOWN; kp = 0; break;
case NSLeftArrowFunctionKey: ch = ARROW_LEFT; kp = 0; break;
case NSRightArrowFunctionKey: ch = ARROW_RIGHT; kp = 0; break;
case NSF1FunctionKey: ch = KC_F1; break;
case NSF2FunctionKey: ch = KC_F2; break;
case NSF3FunctionKey: ch = KC_F3; break;
Expand Down

0 comments on commit 177135a

Please sign in to comment.