mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-17 03:10:58 -08:00
Fix error with fn key in NS port (bug#44533)
* src/nsterm.m ([EmacsView keyDown:]): Move the correction for fn key
handling to before the modifiers are calculated.
(cherry picked from commit 7970610d48)
This commit is contained in:
parent
668f0a7f84
commit
ee6c702e18
1 changed files with 8 additions and 11 deletions
19
src/nsterm.m
19
src/nsterm.m
|
|
@ -6350,6 +6350,14 @@ not_in_argv (NSString *arg)
|
||||||
code = 0xFF08; /* backspace */
|
code = 0xFF08; /* backspace */
|
||||||
else
|
else
|
||||||
code = fnKeysym;
|
code = fnKeysym;
|
||||||
|
|
||||||
|
/* Function keys (such as the F-keys, arrow keys, etc.) set
|
||||||
|
modifiers as though the fn key has been pressed when it
|
||||||
|
hasn't. Also some combinations of fn and a function key
|
||||||
|
return a different key than was pressed (e.g. fn-<left>
|
||||||
|
gives <home>). We need to unset the fn key flag in these
|
||||||
|
cases. */
|
||||||
|
flags &= ~NS_FUNCTION_KEY_MASK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The ⌘ and ⌥ modifiers can be either shift-like (for alternate
|
/* The ⌘ and ⌥ modifiers can be either shift-like (for alternate
|
||||||
|
|
@ -6371,17 +6379,6 @@ not_in_argv (NSString *arg)
|
||||||
Lisp_Object kind = fnKeysym ? QCfunction : QCordinary;
|
Lisp_Object kind = fnKeysym ? QCfunction : QCordinary;
|
||||||
emacs_event->modifiers = EV_MODIFIERS2 (flags, kind);
|
emacs_event->modifiers = EV_MODIFIERS2 (flags, kind);
|
||||||
|
|
||||||
/* Function keys (such as the F-keys, arrow keys, etc.) set
|
|
||||||
modifiers as though the fn key has been pressed when it
|
|
||||||
hasn't. Also some combinations of fn and a function key
|
|
||||||
return a different key than was pressed (e.g. fn-<left> gives
|
|
||||||
<home>). We need to unset the fn modifier in these cases.
|
|
||||||
FIXME: Can we avoid setting it in the first place? */
|
|
||||||
if (fnKeysym && (flags & NS_FUNCTION_KEY_MASK))
|
|
||||||
emacs_event->modifiers
|
|
||||||
^= parse_solitary_modifier (mod_of_kind (ns_function_modifier,
|
|
||||||
QCfunction));
|
|
||||||
|
|
||||||
if (NS_KEYLOG)
|
if (NS_KEYLOG)
|
||||||
fprintf (stderr, "keyDown: code =%x\tfnKey =%x\tflags = %x\tmods = %x\n",
|
fprintf (stderr, "keyDown: code =%x\tfnKey =%x\tflags = %x\tmods = %x\n",
|
||||||
code, fnKeysym, flags, emacs_event->modifiers);
|
code, fnKeysym, flags, emacs_event->modifiers);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue