summaryrefslogtreecommitdiff
path: root/gtk2_ardour/midi_region_view.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-12-06 19:56:36 -0500
committerDavid Robillard <d@drobilla.net>2014-12-06 22:43:06 -0500
commit16d60ef2f7f2f8cb3e912aeb93a959248be181c5 (patch)
tree285b7915d69f1567dcac0ad1e77e7bebfade6563 /gtk2_ardour/midi_region_view.h
parent89be7ae58ceeb4cd478376a718fc53d288f07710 (diff)
Grab keyboard only with note selection.
When entered, the keyboard is grabbed when the selection becomes non-empty, and ungrabbed if it becomes empty again or the region is left or the user switches out of internal mode. This fixes scroll in internal mode and note moving with arrow keys. Also frees up useful keybindings when there is no note selection, which is much nicer than the "nothing works in edit mode at all" greedy grab approach used previously. Attempt #874327892 of getting this damned grabbing right.
Diffstat (limited to 'gtk2_ardour/midi_region_view.h')
-rw-r--r--gtk2_ardour/midi_region_view.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/gtk2_ardour/midi_region_view.h b/gtk2_ardour/midi_region_view.h
index e846fc2764..e2672929cc 100644
--- a/gtk2_ardour/midi_region_view.h
+++ b/gtk2_ardour/midi_region_view.h
@@ -485,8 +485,13 @@ private:
void remove_ghost_note ();
void mouse_mode_changed ();
+ void enter_internal ();
+ void leave_internal ();
+
double _last_event_x;
double _last_event_y;
+ bool _grabbed_keyboard;
+ bool _entered;
framepos_t snap_frame_to_grid_underneath (framepos_t p, framecnt_t &) const;