Commit graph

13 commits

Author SHA1 Message Date
Sebastian Keller
986a37ff6c keyboard: Split out function to normalize keyval and modifier mask
This will allow it to be tested in a unit test in an upcoming commit.
2022-08-22 12:49:13 +00:00
Ian Douglas Scott
67cb508802 keyboard: Refactoring of CcKeyboardItem handling of multiple combos
This commit includes all the changes that seem to be necessary for
CcKeyboardItem to be used for dealing with multiple keybindings, without
(yet) changing the user interface to expose this.

The `primary_combo` and `binding` fields of `CcKeyboardItem` are
removed, in favor of the existing `key_combos`. No combination is
"primary", since all of them can now be seen and changed equally.

We treat `CcKeyboardItem.key_combos` as a set, that a combo can be added
to or removed from. Though it continues to be represented as a `GList`,
instead of a `GHashTable`, to preserve ordering.

A lot of the keyboard panel code relied on the assumption that only one
combo can be set for each setting, so this required a variety of
miscellaneous changes.
2020-09-14 17:19:33 +00:00
Ian Douglas Scott
44959e0049 keyboard: remove some dead code 2020-06-29 00:19:54 +00:00
Florian Müllner
dccf794897 keyboard: Add dedicated key combo type
We currently store keyval, keycode and mask that make up a particular
key combo separately. However as we want to consider multiple bindings
for a single item, it makes more sense to combine them in a dedicated
struct type.

https://bugzilla.gnome.org/show_bug.cgi?id=673078
2017-07-10 19:29:43 +02:00
Florian Müllner
4beb7cefd4 keyboard: Allow Tab in accels
gtk_accelerator_valid() doesn't accept Tab as keyval, so using it to
check whether a shortcut is valid breaks commonly used shortcuts like
Alt+Tab. Unbreak those by adding a small wrapper that special-cases
Tab-with-modifiers.

https://bugzilla.gnome.org/show_bug.cgi?id=771058
2016-09-08 17:38:04 +02:00
Bastien Nocera
69258a91a6 keyboard: Add helper to detect empty keybindings
We'll use this shortly.

https://bugzilla.gnome.org/show_bug.cgi?id=769314
2016-09-08 17:12:17 +02:00
Georges Basile Stavracas Neto
c1529c3417 keyboard: add helper method for user-friendly accelerators
The accelerator formatting method itself is copied from
GtkCellRendererAccel, and will be used throughout the code
to format the accelerators just like they used to be before
moving to the listbox.

https://bugzilla.gnome.org/show_bug.cgi?id=769063
2016-07-29 13:43:47 -03:00
Georges Basile Stavracas Neto
d940d7bb5d keyboard: make it a template class
To allow a much easier porting to the new layout, the keyboard
panel is now a template class. That has various implications on
the code organization:

 - The keyboard-shortcuts.c was responsible for filling the shortcuts.
   Because it relied on the GtkBuilder of the panel, most of its code
   was moved to the CcKeyboardPanel class.
 - The unused code from the keyboard panel class had to be removed in
   order to make it work again.
 - All the hash tables and widgets are now part of the CcKeyboardPanel
   structure.
 - The interface elements have a single entry point.

https://bugzilla.gnome.org/show_bug.cgi?id=769063
2016-07-29 13:43:47 -03:00
Georges Basile Stavracas Neto
dfa01baa9d keyboard: expose structures in header
These structures will be used in future commits when
moving to use a template class.

https://bugzilla.gnome.org/show_bug.cgi?id=769063
2016-07-29 13:43:47 -03:00
Daniel Mustieles
2c5951819d Updated FSF's address 2014-01-29 11:27:38 +01:00
Bastien Nocera
22e31eb3f7 keyboard: Add ability to switch to a shortcuts section
With some new API.

https://bugzilla.gnome.org/show_bug.cgi?id=684280
2012-09-19 00:29:31 +02:00
Bastien Nocera
6665b60422 panels: Update for Shell API changes 2011-11-07 18:03:14 +00:00
Rodrigo Moya
974acd358e keyboard: Separate code for tabs in notebooks 2010-12-09 17:02:41 +01:00