comparison src/events.c @ 263:727739f917cb r20-5b30

Import from CVS: tag r20-5b30
author cvs
date Mon, 13 Aug 2007 10:24:41 +0200
parents 405dd6d1825b
children 966663fcf606
comparison
equal deleted inserted replaced
262:9d8607af9e13 263:727739f917cb
961 } 961 }
962 962
963 963
964 void 964 void
965 character_to_event (Emchar c, struct Lisp_Event *event, struct console *con, 965 character_to_event (Emchar c, struct Lisp_Event *event, struct console *con,
966 int use_console_meta_flag) 966 int use_console_meta_flag, int do_backspace_mapping)
967 { 967 {
968 Lisp_Object k = Qnil; 968 Lisp_Object k = Qnil;
969 unsigned int m = 0; 969 unsigned int m = 0;
970 if (event->event_type == dead_event) 970 if (event->event_type == dead_event)
971 error ("character-to-event called with a deallocated event!"); 971 error ("character-to-event called with a deallocated event!");
998 { 998 {
999 case 'I': k = QKtab; m &= ~MOD_CONTROL; break; 999 case 'I': k = QKtab; m &= ~MOD_CONTROL; break;
1000 case 'J': k = QKlinefeed; m &= ~MOD_CONTROL; break; 1000 case 'J': k = QKlinefeed; m &= ~MOD_CONTROL; break;
1001 case 'M': k = QKreturn; m &= ~MOD_CONTROL; break; 1001 case 'M': k = QKreturn; m &= ~MOD_CONTROL; break;
1002 case '[': k = QKescape; m &= ~MOD_CONTROL; break; 1002 case '[': k = QKescape; m &= ~MOD_CONTROL; break;
1003 #ifdef HAVE_TTY
1004 default: 1003 default:
1005 if (CHARP (con->tty_erase_char) && 1004 #if defined(HAVE_TTY) && !defined(__CYGWIN32__)
1006 c - '@' == XCHAR (con->tty_erase_char)) { 1005 if (do_backspace_mapping &&
1007 k = QKbackspace; 1006 CHARP (con->tty_erase_char) &&
1008 m &= ~MOD_CONTROL; 1007 c - '@' == XCHAR (con->tty_erase_char))
1009 } 1008 {
1009 k = QKbackspace;
1010 m &= ~MOD_CONTROL;
1011 }
1012 #endif /* defined(HAVE_TTY) && !defined(__CYGWIN32__) */
1010 break; 1013 break;
1011 #endif
1012 } 1014 }
1013 if (c >= 'A' && c <= 'Z') c -= 'A'-'a'; 1015 if (c >= 'A' && c <= 'Z') c -= 'A'-'a';
1014 } 1016 }
1015 #ifdef HAVE_TTY 1017 #if defined(HAVE_TTY) && !defined(__CYGWIN32__)
1016 else if (CHARP (con->tty_erase_char) && 1018 else if (do_backspace_mapping &&
1017 c == XCHAR(con->tty_erase_char)) 1019 CHARP (con->tty_erase_char) && c == XCHAR (con->tty_erase_char))
1018 k = QKbackspace; 1020 k = QKbackspace;
1019 #endif 1021 #endif /* defined(HAVE_TTY) && !defined(__CYGWIN32__) */
1020 else if (c == 127) 1022 else if (c == 127)
1021 k = QKdelete; 1023 k = QKdelete;
1022 else if (c == ' ') 1024 else if (c == ' ')
1023 k = QKspace; 1025 k = QKspace;
1024 1026
1170 key_desc_list_to_event (ch, event, 1); 1172 key_desc_list_to_event (ch, event, 1);
1171 else 1173 else
1172 { 1174 {
1173 CHECK_CHAR_COERCE_INT (ch); 1175 CHECK_CHAR_COERCE_INT (ch);
1174 character_to_event (XCHAR (ch), XEVENT (event), con, 1176 character_to_event (XCHAR (ch), XEVENT (event), con,
1175 !NILP (use_console_meta_flag)); 1177 !NILP (use_console_meta_flag), 1);
1176 } 1178 }
1177 return event; 1179 return event;
1178 } 1180 }
1179 1181
1180 void 1182 void