aboutsummaryrefslogtreecommitdiffhomepage
path: root/gtk/ScintillaGTK.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2017-06-12 13:49:46 +1000
committerNeil <nyamatongwe@gmail.com>2017-06-12 13:49:46 +1000
commit1995e565ce6566fced7a383d8114319da57974d5 (patch)
treeabd53d2e1d51cabb86852e9999822e7957b3fce2 /gtk/ScintillaGTK.cxx
parente57183504381c137e851265b0083c429ac65246f (diff)
downloadscintilla-mirror-1995e565ce6566fced7a383d8114319da57974d5.tar.gz
Simplify mouse and keyboard handling by only retaining the 'WithModifiers" form.
All events include a set of keyboard modifier flags. Older calls that passed individual parameters for each key were removed.
Diffstat (limited to 'gtk/ScintillaGTK.cxx')
-rw-r--r--gtk/ScintillaGTK.cxx15
1 files changed, 10 insertions, 5 deletions
diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx
index 1cd94e7ef..3def49966 100644
--- a/gtk/ScintillaGTK.cxx
+++ b/gtk/ScintillaGTK.cxx
@@ -1775,7 +1775,11 @@ gint ScintillaGTK::MouseRelease(GtkWidget *widget, GdkEventButton *event) {
// If mouse released on scroll bar then the position is relative to the
// scrollbar, not the drawing window so just repeat the most recent point.
pt = sciThis->ptMouseLast;
- sciThis->ButtonUp(pt, event->time, (event->state & GDK_CONTROL_MASK) != 0);
+ const int modifiers = ModifierFlags(
+ (event->state & GDK_SHIFT_MASK) != 0,
+ (event->state & GDK_CONTROL_MASK) != 0,
+ (event->state & modifierTranslated(sciThis->rectangularSelectionModifier)) != 0);
+ sciThis->ButtonUpWithModifiers(pt, event->time, modifiers);
}
} catch (...) {
sciThis->errorStatus = SC_STATUS_FAILURE;
@@ -1912,10 +1916,11 @@ gint ScintillaGTK::Motion(GtkWidget *widget, GdkEventMotion *event) {
//Platform::DebugPrintf("Move %x %x %d %c %d %d\n",
// sciThis,event->window,event->time,event->is_hint? 'h' :'.', x, y);
Point pt(x, y);
- int modifiers = ((event->state & GDK_SHIFT_MASK) != 0 ? SCI_SHIFT : 0) |
- ((event->state & GDK_CONTROL_MASK) != 0 ? SCI_CTRL : 0) |
- ((event->state & modifierTranslated(sciThis->rectangularSelectionModifier)) != 0 ? SCI_ALT : 0);
- sciThis->ButtonMoveWithModifiers(pt, modifiers);
+ const int modifiers = ModifierFlags(
+ (event->state & GDK_SHIFT_MASK) != 0,
+ (event->state & GDK_CONTROL_MASK) != 0,
+ (event->state & modifierTranslated(sciThis->rectangularSelectionModifier)) != 0);
+ sciThis->ButtonMoveWithModifiers(pt, event->time, modifiers);
} catch (...) {
sciThis->errorStatus = SC_STATUS_FAILURE;
}