diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-09-21 19:51:29 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-09-21 19:51:29 +0400 |
commit | 1e63545a3b6331b6c1d05a15c5dc48f4aa148f19 (patch) | |
tree | 029bf48af53e18d31bd42c8466fdf1145287f2d8 /source | |
parent | 4453dc330f94ab0865852145cfab444f05cbd463 (diff) |
Second attempt at fixing #19335: holding down backspace in the
text editor creates squares on some systems. Based on info from
Martin, it appears the keymodifier is being set when it shouldn't.
I think this is happening become some systems may be generating
KM_PRESS events without a matching KM_RELEASE?
Also ignore ascii values 1-32 now instead of 14-32, not sure why
they were included now in 2.5 because they were not in 2.4, but
I don't see a reason to do it. This fixes squares when pressing
e.g. ctrl+b or ctrl+n.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 6b07e384f66..4acfe1e524a 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -1600,7 +1600,7 @@ void wm_event_add_ghostevent(wmWindow *win, int type, void *customdata) event.val= (type==GHOST_kEventKeyDown)?KM_PRESS:KM_RELEASE; /* exclude arrow keys, esc, etc from text input */ - if(type==GHOST_kEventKeyUp || (event.ascii<32 && event.ascii>14)) + if(type==GHOST_kEventKeyUp || (event.ascii<32 && event.ascii>0)) event.ascii= '\0'; /* modifiers */ @@ -1630,6 +1630,13 @@ void wm_event_add_ghostevent(wmWindow *win, int type, void *customdata) else if(event.val==KM_RELEASE && event.keymodifier==event.type) event.keymodifier= evt->keymodifier= 0; } + + /* this case happens on some systems that on holding a key pressed, + generate press events without release, we still want to keep the + modifier in win->eventstate, but for the press event of the same + key we don't want the key modifier */ + if(event.keymodifier == event.type) + event.keymodifier= 0; /* if test_break set, it catches this. XXX Keep global for now? */ if(event.type==ESCKEY) |