@@ -655,11 +655,12 @@ void Field_CharEvent( field_t *edit, int ch ) {
655
655
return ;
656
656
}
657
657
658
- if (ch == ' a' - ' a' + 1 ) { // ctrl-a moves field contents to clipboard
658
+ if (ch == ' a' - ' a' + 1 ) { // ctrl-a clears field and copies contents to clipboard
659
659
Sys_SetClipboardData (edit->buffer );
660
660
Field_Clear (edit);
661
661
return ;
662
662
}
663
+
663
664
if ( ch == ' q' - ' a' + 1 ) { // ctrl-q is home
664
665
edit->cursor = 0 ;
665
666
edit->scroll = 0 ;
@@ -685,7 +686,6 @@ void Field_CharEvent( field_t *edit, int ch ) {
685
686
686
687
if (ch == ' "' )
687
688
max -= 2 ;
688
-
689
689
}
690
690
691
691
if ( kg.key_overstrikeMode ) {
@@ -1320,9 +1320,29 @@ void CL_ParseBinding( int key, qboolean down, unsigned time )
1320
1320
1321
1321
if ( cls.state == CA_DISCONNECTED && Key_GetCatcher ( ) == 0 )
1322
1322
return ;
1323
- if ( !kg.keys [keynames[key].upper ].binding || !kg.keys [keynames[key].upper ].binding [0 ] )
1323
+
1324
+ // for rshift/ralt/rctrl, prefer the specific rshift/rctrl/ralt bind if
1325
+ // it exists; otherwise, fallback to the generic shift/ctrl/alt bind
1326
+ const char *binding;
1327
+ int genericKey = 0 ;
1328
+ switch (key) {
1329
+ case A_SHIFT2: genericKey = A_SHIFT; break ;
1330
+ case A_CTRL2: genericKey = A_CTRL; break ;
1331
+ case A_ALT2: genericKey = A_ALT; break ;
1332
+ }
1333
+ if (genericKey) {
1334
+ if (VALIDSTRING (kg.keys [keynames[key].upper ].binding ))
1335
+ binding = kg.keys [keynames[key].upper ].binding ;
1336
+ else
1337
+ binding = kg.keys [keynames[genericKey].upper ].binding ;
1338
+ }
1339
+ else {
1340
+ binding = kg.keys [keynames[key].upper ].binding ;
1341
+ }
1342
+
1343
+ if (!VALIDSTRING (binding))
1324
1344
return ;
1325
- Q_strncpyz ( buf, kg. keys [keynames[key]. upper ]. binding , sizeof ( buf ) );
1345
+ Q_strncpyz (buf, binding, sizeof (buf) );
1326
1346
1327
1347
// run all bind commands if console, ui, etc aren't reading keys
1328
1348
allCommands = (qboolean)( Key_GetCatcher ( ) == 0 );
0 commit comments