[Fuse-for-macosx-commits] SF.net SVN: fuse-for-macosx:[833] trunk/fuse/fusepb
Brought to you by:
fredm
From: <fr...@us...> - 2016-11-01 10:40:58
|
Revision: 833 http://sourceforge.net/p/fuse-for-macosx/code/833 Author: fredm Date: 2016-11-01 10:40:56 +0000 (Tue, 01 Nov 2016) Log Message: ----------- More attempts to fix stuck keys when Tab is combined with Command. Modified Paths: -------------- trunk/fuse/fusepb/keystate.c trunk/fuse/fusepb/keystate.h trunk/fuse/fusepb/models/Emulator.m Modified: trunk/fuse/fusepb/keystate.c =================================================================== --- trunk/fuse/fusepb/keystate.c 2016-10-28 11:30:23 UTC (rev 832) +++ trunk/fuse/fusepb/keystate.c 2016-11-01 10:40:56 UTC (rev 833) @@ -119,7 +119,8 @@ void action_sNORMAL_eRELEASE_NORMAL( input_key keysym ) { - normal_count--; + if( normal_count > 0 ) + normal_count--; // track depth, if depth is 0 switch back to NONE if( !normal_count ) current_state = NONE; release_key(keysym); @@ -172,3 +173,10 @@ /* invalid event/state - shouldn't happen, just ignore for now */ } } + +void +reset_keystate( void ) +{ + current_state = NONE; + normal_count = 0; +} Modified: trunk/fuse/fusepb/keystate.h =================================================================== --- trunk/fuse/fusepb/keystate.h 2016-10-28 11:30:23 UTC (rev 832) +++ trunk/fuse/fusepb/keystate.h 2016-11-01 10:40:56 UTC (rev 833) @@ -37,5 +37,6 @@ }; void process_keyevent( enum events event, input_key keysym ); +void reset_keystate( void ); #endif /* #ifndef KEYSTATE_H */ Modified: trunk/fuse/fusepb/models/Emulator.m =================================================================== --- trunk/fuse/fusepb/models/Emulator.m 2016-10-28 11:30:23 UTC (rev 832) +++ trunk/fuse/fusepb/models/Emulator.m 2016-11-01 10:40:56 UTC (rev 833) @@ -672,13 +672,19 @@ [self modifierChange:INPUT_KEY_Alt_L oldState:optDown newState:optDownNew]; [self modifierChange:INPUT_KEY_Control_L oldState:ctrlDown newState:ctrlDownNew]; [self modifierChange:INPUT_KEY_Shift_L oldState:shiftDown newState:shiftDownNew]; + + optDown = optDownNew; + ctrlDown = ctrlDownNew; + shiftDown = shiftDownNew; } else { keyboard_release_all(); + reset_keystate( ); + + optDown = NO; + ctrlDown = NO; + shiftDown = NO; } - optDown = optDownNew; - ctrlDown = ctrlDownNew; - shiftDown = shiftDownNew; commandDown = commandDownNew; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |