Unbinding Alt-1 Does Not Work

Richard Kimberly Heck rikiheck at gmail.com
Tue Jun 4 01:43:15 UTC 2024


On 6/3/24 16:34, Richard Kimberly Heck wrote:
> On 6/3/24 15:55, Richard Kimberly Heck wrote:
>> A user reported that many of his custom shortcuts were not working. 
>> These used Alt-1, etc, as a prefix (e.g., Alt-1 M). Because 2.4 now 
>> binds Alt-NUM to "Save bookmark NUM", that is not a surprise. What is 
>> a surprise is that it does not seem possible to unbind this. Even if 
>> I unbind Alt-9, say, it still saves bookmark 9.
>>
>> Using -dbg kbmap does not give any useful information. Unbinding does 
>> not seem to generate any messages.
>
> The problem seems to be that the binding is declared as:
>
> M-~S-9
>
> rather than:
>
> M-9
>
> If I change it to the latter, then I can unbind it. So the unbinding 
> routine is failing to deal with the 'ignore' case. I.e., M-9 does not 
> match M-~S-9, so it thinks there's nothing to unbind. And it shows as 
> just M-9 in Tools> Preferences, and that's what it writes to the 
> user.bind file.
>
> It seems to me we should just go ahead and unbind in that case, 
> whether the 'ignore' part matches or not. Thoughts?

Having looked some at the code, it appears that 'ignore' sequences, like 
M-~S-9, do not really get considered in the shortcut machinery. They do 
not get displayed in the GUI, or written to the bind files. (See 
KeySequence::print.)

I would suggest we remove the ~S from the bookmark shortcuts. I don't 
see that it's needed. Longer term, something more needs to be done to 
the shortcut machinery.

Riki




More information about the lyx-devel mailing list