diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2022-01-05 08:40:53 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2022-01-05 08:40:53 +0200 |
commit | 32cbf877ac137b28eb41a9084717707907c02d94 (patch) | |
tree | db971de78c1869a2c3a713080aa6222003e946c6 /src/ui/bindingswidget.c | |
parent | 31312b7a2e51a87a41bf777b6af135329927460d (diff) |
Handling keys while navigating via home row
When navigating via home row, ensure that other widgets will not trigger when keys are pressed. The document is given keyboard focus even though it is not flagged as focusable, to make sure it gets to handle all the keys first.
On macOS, disable all native menu items that have a home row keyboard shortcut.
Also on macOS, disable all native menus when changing bindings.
IssueID #419
Diffstat (limited to 'src/ui/bindingswidget.c')
-rw-r--r-- | src/ui/bindingswidget.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ui/bindingswidget.c b/src/ui/bindingswidget.c index 4cf8df8e..13f9434e 100644 --- a/src/ui/bindingswidget.c +++ b/src/ui/bindingswidget.c | |||
@@ -143,12 +143,16 @@ static void setActiveItem_BindingsWidget_(iBindingsWidget *d, size_t pos) { | |||
143 | item->isWaitingForEvent = iTrue; | 143 | item->isWaitingForEvent = iTrue; |
144 | invalidateItem_ListWidget(d->list, d->activePos); | 144 | invalidateItem_ListWidget(d->list, d->activePos); |
145 | } | 145 | } |
146 | #if defined (iPlatformAppleDesktop) | 146 | #if defined (iPlatformAppleDesktop) && defined (iHaveNativeContextMenus) |
147 | /* Native menus must be disabled while grabbing keys so the shortcuts don't trigger. */ | 147 | /* Native menus must be disabled while grabbing keys so the shortcuts don't trigger. */ |
148 | const iBool enableNativeMenus = (d->activePos == iInvalidPos); | 148 | const iBool enableNativeMenus = (d->activePos == iInvalidPos); |
149 | enableMenu_MacOS("${menu.title.file}", enableNativeMenus); | ||
149 | enableMenu_MacOS("${menu.title.edit}", enableNativeMenus); | 150 | enableMenu_MacOS("${menu.title.edit}", enableNativeMenus); |
150 | enableMenu_MacOS("${menu.title.view}", enableNativeMenus); | 151 | enableMenu_MacOS("${menu.title.view}", enableNativeMenus); |
152 | enableMenu_MacOS("${menu.title.bookmarks}", enableNativeMenus); | ||
151 | enableMenu_MacOS("${menu.title.identity}", enableNativeMenus); | 153 | enableMenu_MacOS("${menu.title.identity}", enableNativeMenus); |
154 | enableMenuIndex_MacOS(6, enableNativeMenus); | ||
155 | enableMenuIndex_MacOS(7, enableNativeMenus); | ||
152 | #endif | 156 | #endif |
153 | } | 157 | } |
154 | 158 | ||