From 53a3850a8a05249942a0c4a16060e9491456af02 Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Fri, 3 Apr 2015 16:21:22 +0200 Subject: Sticky Keys backend Design task: T42339 Differential Revision: D840 Initial implementation proposal: T41867 Short description: With this we can distinguish between holding and tabbing a key. Useful is this if we want to assign to operators to a single shortcut. If two operators are assigned to one shortcut, we call this a sticky key. More info is accessible through the design task and the diff. A few people that were involved with this: * Sean Olson for stressing me with this burden ;) - It is his enthusiasm that pushed me forward to get this done * Campbell and Antony for the code and design review * Ton for the design review * All the other people that gave feedback on the patch and helped to make this possible A big "Thank You" for you all! --- source/blender/editors/space_text/text_ops.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/space_text') diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index ad8050a50e8..6fb5706bfdf 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -2163,6 +2163,11 @@ static int text_scroll_modal(bContext *C, wmOperator *op, const wmEvent *event) case LEFTMOUSE: case RIGHTMOUSE: case MIDDLEMOUSE: + /* don't exit on dummy events */ + if (event->val == KM_NOTHING) { + return OPERATOR_RUNNING_MODAL; + } + if (ELEM(tsc->zone, SCROLLHANDLE_MIN_OUTSIDE, SCROLLHANDLE_MAX_OUTSIDE)) { txt_screen_skip(st, ar, st->viewlines * (tsc->zone == SCROLLHANDLE_MIN_OUTSIDE ? 1 : -1)); @@ -2667,8 +2672,10 @@ static int text_set_selection_modal(bContext *C, wmOperator *op, const wmEvent * case LEFTMOUSE: case MIDDLEMOUSE: case RIGHTMOUSE: - text_cursor_set_exit(C, op); - return OPERATOR_FINISHED; + if (event->val != KM_NOTHING) { + text_cursor_set_exit(C, op); + return OPERATOR_FINISHED; + } case TIMER: case MOUSEMOVE: text_cursor_set_apply(C, op, event); -- cgit v1.2.3