Swap modifier keys

28 views
Skip to first unread message

Josué Andrade Lopes

unread,
Feb 12, 2024, 5:42:47 AMFeb 12
to Ukelele Users
Hi,

I would like to create a keyboard layout that starts fro the portuguese PT layout and the only modification I want is to swap left_control with left_command keys. Also I want to use this layout with one application only and I'm expecting to use the native functionality under "Input source" enabling "Allow a different one for each document". I'm not sure this will work though.

If you have a better suggestion on how to achieve this, please let me know.

Thank you
Josué Lopes

Sorin Paliga

unread,
Feb 12, 2024, 6:04:39 AMFeb 12
to ukelel...@googlegroups.com
The immediate answer is that UKELELE cannot modify system settings, e.g. control or command keys. Nevertheless this may be achieved via a dedicated app called Karabiner:
--
You received this message because you are subscribed to the Google Groups "Ukelele Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ukelele-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ukelele-users/54254ebd-54c2-404f-87e1-12d2b28ff693n%40googlegroups.com.

Josué Andrade Lopes

unread,
Feb 12, 2024, 6:07:54 AMFeb 12
to ukelel...@googlegroups.com
Unfortunately Karabiner doesn’t allow switching profiles for specific apps, I would need to change the profile manually…

That’s why I wanted to create a keyboard layout and assign that one to an app.
I’ll try to find an automation solution for this, but please let me know if you have any ideas.

Thank you for the quick answer

No dia 12/02/2024, às 11:04, Sorin Paliga <sorin....@gmail.com> escreveu:

The immediate answer is that UKELELE cannot modify system settings, e.g. control or command keys. Nevertheless this may be achieved via a dedicated app called Karabiner:



On 12 Feb 2024, at 12:24, Josué Andrade Lopes <josueand...@gmail.com> wrote:

Hi,

I would like to create a keyboard layout that starts fro the portuguese PT layout and the only modification I want is to swap left_control with left_command keys. Also I want to use this layout with one application only and I'm expecting to use the native functionality under "Input source" enabling "Allow a different one for each document". I'm not sure this will work though.

If you have a better suggestion on how to achieve this, please let me know.

Thank you
Josué Lopes

--
You received this message because you are subscribed to the Google Groups "Ukelele Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ukelele-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ukelele-users/54254ebd-54c2-404f-87e1-12d2b28ff693n%40googlegroups.com.


--
You received this message because you are subscribed to a topic in the Google Groups "Ukelele Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ukelele-users/OGR3eUU8xUs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ukelele-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ukelele-users/A4DEFE2D-55E4-4218-930E-8D717B3791AC%40gmail.com.

Gé van Gasteren

unread,
Feb 12, 2024, 6:30:50 AMFeb 12
to ukelel...@googlegroups.com
On Mon, Feb 12, 2024 at 11:42 AM Josué Andrade Lopes <josueand...@gmail.com> wrote:
I would like to create a keyboard layout that starts fro the portuguese PT layout and the only modification I want is to swap left_control with left_command keys. Also I want to use this layout with one application only and I'm expecting to use the native functionality under "Input source" enabling "Allow a different one for each document". I'm not sure this will work though.
 
Hi Josué,

I’m not sure why you’d want to swap those keys, and only in 1 application?

Anyway, to answer your question: you can create such a modified copy with Ukelele, but it’s unsure if that will work as desired with that specific app. 
I quote from the PDF manual:
Control key combinations often do not work as desired. Often, control key combinations are
simply ignored, and sometimes they do something unexpected. There are some ways
around some, if not all, of the limitations, but these are not for the faint of heart!
 
I guess you know that you can swap Ctrl and Cmd keys through the System Settings.
However, because that applies system-wide, you’d need something like an AppleScript to change those settings, plus a shortcut for it.
Still, that could be the best option.
Unless… you can attach a second keyboard just for use with that 1 app: the mentioned System Setting can be different for each attached keyboard.

Sorin Paliga

unread,
Feb 12, 2024, 6:37:02 AMFeb 12
to ukelel...@googlegroups.com
It is obvious, starting from his initial statement:

‘‘the only modification I want is to swap left_control with left_command keys’’

that Karabiner is the simple and, in fact, only reasonable solution for him. 


--
You received this message because you are subscribed to the Google Groups "Ukelele Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ukelele-user...@googlegroups.com.

Josué Andrade Lopes

unread,
Feb 12, 2024, 6:47:27 AMFeb 12
to ukelel...@googlegroups.com
I’ve started to work with Azure Bastion which is an RDP solution inside a browser. I’m connecting to a windows VM and the only thing that is messing me up is the control and command keys. I’m not able to use an RDP app that would map these keys for me.
I also don’t want to map these keys inside windows. Instead I want to use Edge app just for Bastion, and I would like to be able to swap these keys only for edge app.

Makes sense the functionality only works for different keyboards, I didn’t understand fully the native functionality…

I might be better off with an apple script to do this swap depending on focus, I’ll test it.

I do have Karabiner and I have already made this change (and of course it works), but I don’t want to be constantly changing the profile in Karabiner every time I switch between Edge and other apps.

--
You received this message because you are subscribed to a topic in the Google Groups "Ukelele Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ukelele-users/OGR3eUU8xUs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ukelele-user...@googlegroups.com.

Sorin Paliga

unread,
Feb 12, 2024, 6:59:36 AMFeb 12
to ukelel...@googlegroups.com


On 12 Feb 2024, at 13:47, Josué Andrade Lopes <josueand...@gmail.com> wrote:

I do have Karabiner and I have already made this change (and of course it works), but I don’t want to be constantly changing the profile in Karabiner every time I switch between Edge and other apps.

Your initial message did not include this detail, though. :)
Details are always crucial. 

Josué Andrade Lopes

unread,
Feb 12, 2024, 7:02:57 AMFeb 12
to ukelel...@googlegroups.com
Sorry I was trying to see if there was a way to do this using Ukelele (because I thought I could use the native functionality to my advantage)

--
You received this message because you are subscribed to a topic in the Google Groups "Ukelele Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ukelele-users/OGR3eUU8xUs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ukelele-user...@googlegroups.com.

Sorin Paliga

unread,
Feb 12, 2024, 7:14:27 AMFeb 12
to ukelel...@googlegroups.com
AFAIK, UKELELE cannot modify system keys and, frankly speaking, I have never tried to do that being afraid I lose my precious time. This is quite clearly stated in the documentation. Secondly, modifying system functionality always is a dangerous attempt (even if the documentation of Karabiner says it is safe). 
Nevertheless you may try to do that, but remember that the primary, and in fact unique, scope of UKELELE is to allow customizable keylayouts, not to modify system commands. This means you can achieve chars or combinations of chars unavailable via the system keylayouts, e.g. for linguistic or dialectal use. 
I cannot test what you mentioned in your last comments, as I do not use those apps. Perhaps you may try other non-intrusive solutions. 


You received this message because you are subscribed to the Google Groups "Ukelele Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ukelele-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ukelele-users/5F50D3B6-88B0-4080-91AB-389E612A6E40%40gmail.com.

Reply all
Reply to author
Forward
0 new messages