commit e23b2841a71b1bfef617b6342dc1744261ff0d17
parent c0a09fef53d7ae892837c2b94892ad4728e7fb0f
Author: Michael Savage <mikejsavage@gmail.com>
Date: Thu, 6 Sep 2018 11:29:01 +0300
Send lowercase key names to the macro handler, even with shift held. Matches Windows
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/x11.cc b/src/x11.cc
@@ -574,6 +574,10 @@ static void event_key_press( XEvent * xevent ) {
int len = XLookupString( event, keyBuffer, sizeof( keyBuffer ), &key, NULL );
+ event->state &= ~ShiftMask;
+ char noShiftKeyBuffer[ 32 ];
+ int noShiftLen = XLookupString( event, noShiftKeyBuffer, sizeof( noShiftKeyBuffer ), NULL, NULL );
+
switch( key ) {
case XK_Return:
input_return();
@@ -677,7 +681,7 @@ static void event_key_press( XEvent * xevent ) {
default:
if( ctrl || alt ) {
- script_doMacro( keyBuffer, len, shift, ctrl, alt );
+ script_doMacro( noShiftKeyBuffer, noShiftLen, shift, ctrl, alt );
}
else if( len > 0 ) {
input_add( keyBuffer, len );