# HG changeset patch # User Eli Zaretskii # Date 854898087 0 # Node ID 4ca0a5e256050324e2550f18342b60b4552dc937 # Parent df9f838f255af181efed8ff417d1d301d4cf1765 dos_rawgetc: When international keyboard doesn't have to be supported, recognize Alt-key combinations even if the Alt key is no longer pressed. diff -r df9f838f255a -r 4ca0a5e25605 src/msdos.c --- a/src/msdos.c Sun Feb 02 09:51:09 1997 +0000 +++ b/src/msdos.c Sun Feb 02 15:41:27 1997 +0000 @@ -1646,7 +1646,19 @@ if (c == 0) { - if (code & Alt) + /* We only look at the keyboard Ctrl/Shift/Alt keys when + Emacs is ready to read a key. Therefore, if they press + `Alt-x' when Emacs is busy, by the time we get to + `dos_get_modifiers', they might have already released the + Alt key, and Emacs gets just `x', which is BAD. + However, for keys with the `Map' property set, the ASCII + code returns zero iff Alt is pressed. So, when we DON'T + have to support international_keyboard, we don't have to + distinguish between the left and right Alt keys, and we + can set the META modifier for any keys with the `Map' + property if they return zero ASCII code (c = 0). */ + if ( (code & Alt) + || ( (code & 0xf000) == Map && !international_keyboard)) modifiers |= meta_modifier; if (code & Ctrl) modifiers |= ctrl_modifier;