Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Mar 2023 13:02:51 +0100
From:      Matthias Apitz <guru@unixarea.de>
To:        freebsd-questions@freebsd.org
Subject:   Re: Moving a FreeBSD/X11 keyboard confif to Macbook Pro
Message-ID:  <Y/8%2B68gDuGO/ANkM@c720-r368166>
In-Reply-To: <20230301074107.GB9@sh4-5.1blu.de>
References:  <20230301074107.GB9@sh4-5.1blu.de>

next in thread | previous in thread | raw e-mail | index | archive | help
El día miércoles, marzo 01, 2023 a las 08:41:07a. m. +0100, Matthias Apitz escribió:

> 
> Hello,
> 
> This might be in half part off topic, but if I ask this in a Macbook
> mailing list (don't even know if such lists exist), it would also be
> half off topic there :-)
> 
> I'm running FreeBSD for nearly 30 years now and with a X11 keyboard
> configuration which allows me to type German/English/Spanish at the same
> time, usind for the later the useless Windows-key as a modifier key. The
> config is done by some simple script like this:
> 
> /usr/local/bin/setxkbmap -model pc105 \
>           -layout de,us   \
> 	  -option "altwin:swap_alt_win"   \
> 	  -option "lv3:ralt_switch"
> 
> # we use the Win-key to add more (esp. Spanish) letters to the keys:
> #
> # Spanish tilded chars (use Mode_switch + char)
> #
> xmodmap -e "keycode 133 =  Mode_switch"
> xmodmap -e "keycode 0x39 =  n N ntilde Ntilde"
> xmodmap -e "keycode 0x1a =  e E eacute Eacute"
> xmodmap -e "keycode 0x26 =  a A aacute Aacute"
> xmodmap -e "keycode 0x1f =  i I iacute Iacute"
> xmodmap -e "keycode 0x1e =  u U uacute Uacute"
> xmodmap -e "keycode 0x20 =  o O oacute Oacute"
> xmodmap -e "keycode 0x14 =  questiondown question backslash ssharp"
> xmodmap -e "keycode 0x0a =  1 exclam exclamdown onesuperior"
> #
> ...

I figured it out; one can create a dir and a file in it with the
following syntax:

/* to be placed into the (created) directory /Users/apitzm/Library/KeyBindings as file DefaultKeyBinding.dict */

{
"~q"  = ("insertText:", "@");
"~a"  = ("insertText:", "á");
"~A"  = ("insertText:", "Á");
"~e"  = ("insertText:", "é");
"~E"  = ("insertText:", "É");
"~i"  = ("insertText:", "í");
"~I"  = ("insertText:", "Í");
"~o"  = ("insertText:", "ó");
"~O"  = ("insertText:", "Ó");
"~?"  = ("insertText:", "¿");
"~!"  = ("insertText:", "¡");
"~<"  = ("insertText:", "«");
"~>"  = ("insertText:", "»");

"~m"  = ("insertText:", "ñ");   /* ñ not working , why? */
"~M"  = ("insertText:", "Ñ");   /* Ñ not working , why? */
}

Only two keys are currently not working as expected, but I use the 'm' 
key + option-key to get ñ :-)

	matthias

-- 
Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Y/8%2B68gDuGO/ANkM>