On Fri, Feb 24, 2017 at 9:09 AM, jkn <[email protected]> wrote:

> Hi Edward
>
> On Friday, February 24, 2017 at 2:43:14 PM UTC, Edward K. Ream wrote:
>>
>> On Fri, Feb 24, 2017 at 8:16 AM, jkn <[email protected]> wrote:
>>
>> Is it possible to disable the default action (due to Qt, I think) that
>>> when you press the Alt key the menu bar receives the focus of the next
>>> keystroke?
>>>
>>
>> ​I think the answer is yes, but you almost certainly do not need to do
>> this.  See below.
>> ​
>>
>>
>>> I want to rebind some Alt-<whatever> keys but this behaviour is, I
>>> think, preventing them from working. I am happen to accept having to access
>>> items under the menu in a different way (via the mouse...)
>>>
>>
>> ​Alt-key bindings work, for sure.​
>>
>> ​See leoSettings.leo for many examples.​
>>
>> one workaround might be to define the menu headings without accelerators,
>>> but I am hoping not to have to do that.
>>>
>>
>> ​I'm not sure what the trouble is, but there should be no need for heroic
>> measures.
>>
>> Edward
>>
>
> Many of the Alt-key bindings do work, for sure. But if I have, for
> instance, in myLeoSettings.leo:
>
> @settings
>     @keys
>         @shortcuts
>             save-file = Alt-w
>
> (so that this is listed with print-bindings)
>
> then the Alt-W keystroke combination brings up the Window menu (Arrange
> Panes // Equal Sized panes...) at the top of the window frame, instead of
> what I want.
>
> So AFAICT Alt-F (File), Alt-E (Search), Alt-O (Outline), Alt-C (Cmds),
> Alt-W (Window) and Alt-H (Help) are not usefully available. I hope that
> clarifies a bit.
>

​@shortcuts Menu commands​ contains:

# These commands do nothing except serve as placeholders for the
print-bindings command.
menu-shortcut = Alt-C # Cmds menu.
menu-shortcut = Alt-E # Edit menu.
menu-shortcut = Alt-F # File menu.
menu-shortcut = Alt-H # Help menu.
menu-shortcut = Alt-O # Outline menu.
menu-shortcut = Alt-P # Plugins menu.
menu-shortcut = Alt-S # Search and Settings menus.
menu-shortcut = Alt-W # Window menu.

It's possible that they can't be over-ridden. However, the Alt-Shift
variants don't open the menus, so perhaps you could try those.

Let's enable tracing in eventFilter. Releasing (not pressing), the plain
Alt key, and all the Alt keys listed above generate only event 112, which
is only a status-tip event.  See this page
<http://doc.qt.io/qt-4.8/qevent.html>, for example.

In short, it does not appear to be easy to override the Alt-keys
corresponding to menus.  It's probably built in, at least on Windows.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to