diff options
author | corvid <corvid@lavabit.com> | 2012-12-28 20:26:14 +0000 |
---|---|---|
committer | corvid <corvid@lavabit.com> | 2012-12-28 20:26:14 +0000 |
commit | 039a753c9fde97ec64458ca780ba9f49e20bbd3f (patch) | |
tree | d6d49f92e1067e95fab89fa7eb04653508c620e1 /dw | |
parent | 3b3f0a9b870470b4ebca82eba1c4ef677327ac97 (diff) |
don't let form Input widgets or Location eat Page_Up/Down
Diffstat (limited to 'dw')
-rw-r--r-- | dw/fltkui.cc | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/dw/fltkui.cc b/dw/fltkui.cc index a43edf15..6f54c08f 100644 --- a/dw/fltkui.cc +++ b/dw/fltkui.cc @@ -60,21 +60,28 @@ int CustInput2::handle(int e) // We're only interested in some flags unsigned modifier = Fl::event_state() & (FL_SHIFT | FL_CTRL | FL_ALT); - if (e == FL_KEYBOARD && modifier == FL_CTRL) { - if (k == 'a' || k == 'e') { - position(k == 'a' ? 0 : size()); - return 1; - } else if (k == 'k') { - cut(position(), size()); - return 1; - } else if (k == 'd') { - cut(position(), position()+1); - return 1; - } else if (k == 'i' || k == 'j' || k == 'l' || k == 'm') { - // Fl_Input wants to "insert a few selected control characters - // literally", but this gets in the way of key commands. + if (e == FL_KEYBOARD) { + if (k == FL_Page_Down || k == FL_Page_Up) { + // These do nothing of interest when FL_MULTILINE_INPUT isn't set. + // Let them through for key commands. return 0; } + if (modifier == FL_CTRL) { + if (k == 'a' || k == 'e') { + position(k == 'a' ? 0 : size()); + return 1; + } else if (k == 'k') { + cut(position(), size()); + return 1; + } else if (k == 'd') { + cut(position(), position()+1); + return 1; + } else if (k == 'i' || k == 'j' || k == 'l' || k == 'm') { + // Fl_Input wants to "insert a few selected control characters + // literally", but this gets in the way of key commands. + return 0; + } + } } return Fl_Input::handle(e); } |