[Cuis-dev] modifier keys
Juan Vuletich
juan at cuis.st
Thu Jan 15 06:19:34 PST 2026
Hi Luciano,
On 2026-01-15 5:21 AM, Luciano Notarfrancesco via Cuis-dev wrote:
> Interesting, perhaps they do that in that mechanical keyboard because
> Alt and Command have commonly the same position in the keyboard? But
> they are conceptually different keys, and mechanical keyboards usually
> have firmware that can be set to Mac or PC mode with a keystroke, and
> changes the flags that the modifier keys set in the HID codes sent to
> the computer, right?
I don't know if that's right. My Logitech mechanical keyboard may allow
that, but I never found the need. I use it with MacOS, and virtualized
Ubuntu and Windows. Have tweaked a bit keyboard settings both @ MacOS
and VMware level, though.
> I see that mostly Alt is identified with Option, not Cmd. See for
> example the Alt page in wikipedia: https://en.wikipedia.org/wiki/Alt_key
> Or Apple documentation:
> https://developer.apple.com/documentation/uikit/uikeymodifierflags?language=objc
You're right! I had forgotten I had configured MacOS to swap option and
command on my Logi keyboard. The MacBook keyboard swaps their position,
and the inconsistency between both keyboards was driving me insane.
> I think the use of the keys in Cuis is a good tradeoff, I’m not
> proposing to change the editor shortcuts or any shortcuts that people
> are used to (and they are user-configurable anyway). But I’d like to
> have more consistent access to modifier keys across Mac and PC, and
> use them properly in my software following UX best practices and
> conventions. For example the tracker I’m developing, as most trackers,
> is very keyboard-oriented, and with good and consistent keyboard
> mappings the workflow can be very smooth and you can program songs
> super fast. I’d also like to use mostly the same shortcuts that
> Renoise uses in both Mac and PC.
Supporting that kind of use is our top priority. I mean it.
> That’s why lately I found the need to both primary and secondary
> hotkeys, that are usually implemented with Command and Option on Mac
> and Control and Alt on PC. So I need separate access to modifier keys.
Makes sense! (*1) (See below)
> I think we can actually do this in Cuis without disrupting the
> existing mapping. What confused me was the idea that we shouldn't use
> the Option key in Cuis because it's not portable, and the fact that
> the VM translates Alt as Command in Windows. Looking at the VM source
> code for each platform, I see we have the following modifiers in
> Cuis/Squeak: Control, Command, Option, Shift. This follows Mac naming
> conventions, but it is internally consistent in Cuis even in Windows
> platforms. What the VM does in Windows is to map Alt to Command,
> Control without Alt to Control, and Control+Alt to Option.
> This is why Alt seems to be the same as Command, they are not
> originally the same, it's just a translation made by the VM.
I wasn't aware of this.
> So I don't think the Option key should be forbidden as "unportable",
> and we could use it more freely to have richer hotkeys and gestures.
> For example, instead of rawMacOptionKeyPressed I think it should just
> be called just optionKeyPressed, and remove warnings or references to
> Mac regarding the Option key because it is actually a Squeak/Cuis
> modifier key.
Makes sense. I'd still include a comment saying "to generate this, use
[control]+[alt] on Windows and Linux".
The reason I made it scary to use Option is that I assumed that anyone
happily developing on a Mac was at risk of writing software with
features that would only be accessible on a Mac. But if there's a way to
generate it on Windows and Linux, I'm all for it. Please prepare a cs
doing as you say.
> Same for the Command key, currently the selector commandAltKeyPressed
> seems too platform-specific, I think calling it just commandKeyPressed
> would be more appropriate for Cuis (it is the internal Cuis modifier
> key, not the platform key). What do you think?
I'm not so sure about this one. On Linux and Windows, the way to
generate that is the Alt key. Removing that could be a bit alienating to
Linux and Windows users.
I'd like to go back to something you said above (*1). I think we need
the concept of primary and secondary modifier key. We need something
like #isPrimaryModifier and #isSecondaryModifier, or whatever names suit
you and additional functionality you may need. These would be platform
specific and behave as you described. Are you willing to write this
code? I'd be delighted to integrate it.
Thanks!
>
> On Wed, Jan 14, 2026 at 22:05 Juan Vuletich <juan at cuis.st> wrote:
>
> Hi Luciano,
>
> The thing is that "Alt" and "Command" are actually the same key!
> Keyboard hardware for regular PCs and Macs is electronically
> equivalent.
> For instance, click on the first picture at
> https://www.logitech.com/en-us/shop/p/mx-mechanical . The 3 keys
> at the
> bottom left are [ctrl] [option|start] [command|alt] , with dual
> PC/Mac
> names engraved on them.
>
> The decision here is between being more consistent with the
> platform, or
> making Cuis more consistent with itself, regardless of the
> platform. The
> use of Morphic, and not a platform specific UI toolkit suggests the
> second option, and it has been what we have done so far.
>
> In any case, on Text Editors things like cmd-a and ctrl-a behave the
> same, both doing "select all". That's the easiest way to make it
> consistent for everybody, but that wastes key combinations!
>
> But we can change that.
>
> I guess it could be useful to start with some concrete examples
> that you
> think should behave differently than they do today. Can you
> suggest a few?
>
> Thanks!
>
> On 2026-01-14 4:35 AM, Luciano Notarfrancesco via Cuis-dev wrote:
> > In Cuis we are equating the Command key in Mac with the Alt key
> in PC.
> > I think this is wrong, the convention for multiplatform
> applications
> > is to identify Command in Mac with Control in PC (although Mac also
> > has Control), and Alt is identified with Option (they are used to
> > modify the behavior of the hotkey or gesture, i.e. to provide an
> > alternate action or a second option in addition to the primary
> action).
> >
> > Is there a good reason for this in Cuis? Does Squeak do something
> > different? Should we change it to make it more consistent with
> > conventions?
> >
> --
> Juan Vuletich
> www.cuis.st <http://www.cuis.st>
> github.com/jvuletich <http://github.com/jvuletich>
> researchgate.net/profile/Juan-Vuletich
> <http://researchgate.net/profile/Juan-Vuletich>
> independent.academia.edu/JuanVuletich
> <http://independent.academia.edu/JuanVuletich>
> patents.justia.com/inventor/juan-manuel-vuletich
> <http://patents.justia.com/inventor/juan-manuel-vuletich>
>
>
--
Juan Vuletich
www.cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20260115/a7e0c6b4/attachment.htm>
More information about the Cuis-dev
mailing list