13
0

implement group_override_modifier() (lib part)

Consistently use Tertiary for Group Override on all platforms (and be consistent about it)

Consistently use Primary-mod for Momentary on all platforms (partially reverts 47932f)
Primary modifier is used for fine-adjust on knobs and sliders, with no analogous operation on switches.
This commit is contained in:
Ben Loftis 2022-06-20 19:56:10 -05:00
parent 4dbdaf7fe9
commit e557245bf7
2 changed files with 16 additions and 4 deletions

View File

@ -80,6 +80,7 @@ class LIBGTKMM2EXT_API Keyboard : public sigc::trackable, PBD::Stateful
static const char* button2_name ();
static const char* momentary_push_name ();
static const char* group_override_event_name ();
static const char* primary_modifier_short_name ();
static const char* secondary_modifier_short_name ();
@ -165,6 +166,7 @@ class LIBGTKMM2EXT_API Keyboard : public sigc::trackable, PBD::Stateful
static bool is_context_menu_event (GdkEventButton*);
static bool is_button2_event (GdkEventButton*);
static bool is_momentary_push_event (GdkEventButton*);
static bool is_group_override_event (GdkEventButton*);
static Keyboard& the_keyboard() { return *_the_keyboard; }
@ -212,6 +214,7 @@ class LIBGTKMM2EXT_API Keyboard : public sigc::trackable, PBD::Stateful
static guint snap_delta_mod;
static guint button2_modifiers;
static guint momentary_push_modifiers;
static guint group_override_modifiers;
static Gtk::Window* current_window;
static std::string user_keybindings_path;
static bool can_save_keybindings;

View File

@ -71,7 +71,6 @@ guint Keyboard::Level4Modifier = GDK_MOD1_MASK; // Alt/Option
guint Keyboard::CopyModifier = GDK_CONTROL_MASK; // Control
guint Keyboard::RangeSelectModifier = GDK_SHIFT_MASK;
guint Keyboard::button2_modifiers = Keyboard::SecondaryModifier|Keyboard::Level4Modifier;
guint Keyboard::momentary_push_modifiers = Keyboard::TertiaryModifier;
const char* Keyboard::primary_modifier_name() { return _("Command"); }
const char* Keyboard::secondary_modifier_name() { return _("Control"); }
@ -79,7 +78,7 @@ const char* Keyboard::tertiary_modifier_name() { return S_("Key|Shift"); }
const char* Keyboard::level4_modifier_name() { return _("Option"); }
const char* Keyboard::button2_name() { return _("Middle Click (or Ctrl+Alt+Click)"); } // TODO build dynamically depending on Keyboard::button2_modifiers
const char* Keyboard::momentary_push_name() { return _("Shift+Click (or Middle-Click)"); } // TODO formay dynamically depending on Keyboard::momentary_push_modifiers -- Keyboard::tertiary_modifier_name
const char* Keyboard::momentary_push_name() { return _("Cmd+Click (or Middle-Click)"); } // TODO formay dynamically depending on Keyboard::momentary_push_modifiers -- Keyboard::tertiary_modifier_name
const char* Keyboard::primary_modifier_short_name() { return _("Cmd"); }
const char* Keyboard::secondary_modifier_short_name() { return _("Ctrl"); }
@ -98,7 +97,6 @@ guint Keyboard::Level4Modifier = GDK_MOD4_MASK|GDK_SUPER_MASK; // Mod4/Windows
guint Keyboard::CopyModifier = GDK_CONTROL_MASK;
guint Keyboard::RangeSelectModifier = GDK_SHIFT_MASK;
guint Keyboard::button2_modifiers = 0; /* not used */
guint Keyboard::momentary_push_modifiers = 0; /* not used */
const char* Keyboard::primary_modifier_name() { return _("Control"); }
const char* Keyboard::secondary_modifier_name() { return _("Alt"); }
@ -106,7 +104,7 @@ const char* Keyboard::tertiary_modifier_name() { return S_("Key|Shift"); }
const char* Keyboard::level4_modifier_name() { return _("Windows"); }
const char* Keyboard::button2_name() { return _("Middle-Click"); }
const char* Keyboard::momentary_push_name() { return _("Middle-Click"); }
const char* Keyboard::momentary_push_name() { return _("Cmd+Click or Middle-Click"); }
const char* Keyboard::primary_modifier_short_name() { return _("Ctrl"); }
const char* Keyboard::secondary_modifier_short_name() { return _("Alt"); }
@ -118,6 +116,11 @@ guint Keyboard::snap_delta_mod = Keyboard::SecondaryModifier|Keyboard::Level4Mod
#endif
guint Keyboard::momentary_push_modifiers = Keyboard::PrimaryModifier;
guint Keyboard::group_override_modifiers = Keyboard::TertiaryModifier;
const char* Keyboard::group_override_event_name() { return tertiary_modifier_name(); }
guint Keyboard::GainFineScaleModifier = Keyboard::PrimaryModifier;
guint Keyboard::GainExtraFineScaleModifier = Keyboard::SecondaryModifier;
@ -554,6 +557,12 @@ Keyboard::is_momentary_push_event (GdkEventButton* ev)
((ev->state & RelevantModifierKeyMask) == Keyboard::momentary_push_modifiers));
}
bool
Keyboard::is_group_override_event (GdkEventButton* ev)
{
return ((ev->button == 1) && ((ev->state & RelevantModifierKeyMask) == Keyboard::group_override_modifiers));
}
bool
Keyboard::is_delete_event (GdkEventButton *ev)
{