Re: [code][textadept] New keybinding syntax

From: Mitchell <m.att.foicica.com>
Date: Wed, 1 Jul 2020 10:04:32 -0400 (EDT)

Hi Robert,

On Tue, 30 Jun 2020, Robert Gieseke wrote:

> On 30.06.20 16:37, Mitchell wrote:
>>> You can have both Meta and Alt (the "Windows" key would be Meta) on Linux.
>>> Not sure how common that is, or whether you'd want access to both in TA.
>>
>> I'm not sure if the "Windows" key is reported as GDK_META_MASK or GDK_SUPER_MASK on Linux. (I've mapped my "Windows" key to be a compose key.)
>>
>> On Mac you can have both Cmd and Alt. I thought Textadept had some Cmd+Alt bindings somewhere, but I was wrong.
>>
>> Robert, instead of supplying `keys.CMD = keys.ALT` and asking whether or not it is possible, what is the idea you're trying to express? Sorry it's still not clear to me.
>
> I think i'd like to have it as simple as possible to have the same
> keybinding on Linux, Terminal, Mac ...
>
> Cmd and Alt are essentially the key next to the space bar and i believe
> the terminal meta key is most often Alt (or Option on macOS), thus it
> could be just "Meta+" maybe, or "Meta", "Cmd" or "Alt" could all map to
> the respective platform key.

So `keys['meta+a']` would be Alt+A in curses, Cmd+A on Mac, and ? on Win32/Linux? The trouble is that Cmd and Alt/Option are separate modifiers on Mac and I don't see how they can easily be distilled into a single modifier.

> Maybe i'm missing something though or it makes a clear distinction
> between platforms more difficult ...

Are you trying to have one key sequence string that can apply to all platforms? If I want a single key setting for all platforms, I use this form:

   keys[CURSES and 'meta+.' or OSX and 'ctrl+.' or 'alt+.'] = ...

Cheers,
Mitchell

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Wed 01 Jul 2020 - 10:04:32 EDT

This archive was generated by hypermail 2.2.0 : Thu 02 Jul 2020 - 06:33:56 EDT