Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Change modifier type for keybindings page. #1290

Merged
merged 1 commit into from

3 participants

@mtwebster
Collaborator

Turns out, MODIFIER_TAP only seems to exist for Ubuntu (I found it in
devhelp), but not in GTK proper, so invalid in pure GTK environments.

This prevents the ability to set a single modifier key as a keybinding,
but all other key combinations are possible as normal.

Fixes #1289

@dalcde
Collaborator

Can we do

try:
    entry_cell.set_property('accel-mode', Gtk.CellRendererAccelMode.MODIFIER_TAP)
except Exception:
    entry_cell.set_property('accel-mode', Gtk.CellRendererAccelMode.OTHER)

so that setting a single modifier key is possible when it is supported?

@mtwebster mtwebster Use MODIFIER_TAP where allowed, otherwise use OTHER.
Some GTK versions allow a single tap of a modifier to
act as a keybinding, while pure Gnome GTK does not.
db7edd9
@clefebvre clefebvre merged commit 64057e2 into linuxmint:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 20, 2012
  1. @mtwebster

    Use MODIFIER_TAP where allowed, otherwise use OTHER.

    mtwebster authored
    Some GTK versions allow a single tap of a modifier to
    act as a keybinding, while pure Gnome GTK does not.
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 1 deletion.
  1. +6 −1 files/usr/lib/cinnamon-settings/cinnamon-settings.py
View
7 files/usr/lib/cinnamon-settings/cinnamon-settings.py
@@ -1586,7 +1586,12 @@ def build(self):
entry_cell.connect('accel-edited', self.onEntryChanged, self.entry_store)
entry_cell.connect('accel-cleared', self.onEntryCleared, self.entry_store)
entry_cell.set_property('editable', True)
- entry_cell.set_property('accel-mode', Gtk.CellRendererAccelMode.MODIFIER_TAP)
+
+ try: # Only Ubuntu allows MODIFIER_TAP - using a single modifier as a keybinding
+ entry_cell.set_property('accel-mode', Gtk.CellRendererAccelMode.MODIFIER_TAP)
+ except Exception: # Pure GTK does not, so use OTHER
+ entry_cell.set_property('accel-mode', Gtk.CellRendererAccelMode.OTHER)
+
entry_column = Gtk.TreeViewColumn(_("Keyboard bindings"), entry_cell, text=0)
entry_column.set_alignment(.5)
self.entry_tree.append_column(entry_column)
Something went wrong with that request. Please try again.