[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: What's the simplest way to map "CTRL + ALT" to "AltGr" [query]



Am 12/06/2023 um 08:42 schrieb Ottavio Caruso:
Am 11/06/2023 um 13:03 schrieb David Wright:
On Sat 10 Jun 2023 at 09:52:43 (+0000), Ottavio Caruso wrote:
Is there a simple way, without installing gazillion programs and
tweaking tens of configuration files, to have at startup the
combination of CTRL and left ALT produce the same result as AltGr?
This must work for both console and Xorg.

Take a look at /usr/share/X11/xkb/rules/base.lst where you
see that grp changes to another layout; "switch" means holding
the shifting key to switch, whereas "toggle" means tap it
without having to hold it down (like accessibility shift keys
typically work).

   grp:toggle           Right Alt

appears to show the definition for AltGr, so your equivalent
would seem to be

   grp:ctrl_alt_toggle  Alt+Ctrl

and your file shows the WinKey + SpaceBar definition. There are
examples that use this last key combination in the Arch wiki.

As for consoles, I've not used grp in keyboard definitions myself.

$ cat .xsessionrc

I use /etc/default/locale to set locale variables, viz:

$ cat /etc/default/locale
# LC_CTYPE added to overall C
# This file gets (generated and) updated by update-locale,
# but the contents should remain stable under normal circumstances.
LANG=C.UTF-8
LC_CTYPE="en_GB.UTF-8"
#
$

Cheers,
David.




Thanks David, that is neat, but... I have no idea how to implement it. Do I have to manually edit files or use setxkbmap?

I already have:

XKBOPTIONS="grp:win_space_toggle"

in  /etc/default/keyboard

$ setxkbmap -option "grp:win_space_toggle" ,  "grp:ctrl_alt_toggle Alt+Ctrl"


and then:

sudo service keyboard-setup restart


But nothing happens.

Or should I use "localectl" ?

I've also manually edited /etc/default/keyboard



XKBMODEL="pc105"
XKBLAYOUT="de"
XKBVARIANT=""
XKBOPTIONS="grp:win_space_toggle","grp:ctrl_alt_toggle Alt+Ctrl"
BACKSPACE="guess"



then:


$ sudo service keyboard-setup restart
$ sudo udevadm trigger --subsystem-match=input --action=change


but I can't see any changes.


--
Ottavio Caruso

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?


Reply to: