Key remapping <SOLVED - again>

Please post suggestions for improvement of Cinnamon here
https://github.com/linuxmint/Cinnamon
Post Reply
User avatar
lsemmens
Level 8
Level 8
Posts: 2339
Joined: Wed Sep 10, 2014 9:07 pm
Location: Rural South Australia

Key remapping <SOLVED - again>

Post by lsemmens » Sun May 05, 2019 1:12 am

Based on a question from [urlhttps://forums.linuxmint.com/viewtopic.php?p=1629621#p1629621]here[/url], it occurs to me that there should be a method to remap any key on the keyboard. My [ key does not work, and, although I have a workaround, I would like to remap it to a key that I only use rarely.
Last edited by lsemmens on Thu Sep 05, 2019 12:22 am, edited 3 times in total.
Kernel: 4.15.0-46-generic x86_64 bits
Desktop: Cinnamon 3.8.9
Distro: Linux Mint 19 Tara

Laptop HP-ProBook-470-G2 8Gb RAM SSD
Server AMD Phenom 9650 - GEForce 9400GT 6Gb RAM
+ three other Mint machines
Out of my mind - please leave a message

deepakdeshp
Level 15
Level 15
Posts: 5622
Joined: Sun Aug 09, 2015 10:00 am

Re: Key remapping

Post by deepakdeshp » Sun May 05, 2019 2:00 am

If I have helped you solve a problem, please add [SOLVED] to your first post title, it helps other users looking for help, and keeps the forum clean.
Regards,
Deepak

I am using Mint 19.2 Cinnamon 64 bit with AMD A8/7410 processor . Memory 8GB

User avatar
administrollaattori
Level 15
Level 15
Posts: 5881
Joined: Tue Sep 03, 2013 4:51 am
Location: Finland
Contact:

Re: Key remapping

Post by administrollaattori » Sun May 05, 2019 3:10 am

The next way worked perfectly in my laptop.
[SOLVED] How to mapping any key to another any key? ->
viewtopic.php?t=282482#p1559702

magnus7
Level 3
Level 3
Posts: 169
Joined: Sat Jan 30, 2016 8:46 pm

Re: Key remapping

Post by magnus7 » Sun May 05, 2019 9:04 am

Which keyboard layout do you want to modify?
Which symbols do you want to add and in what positions? (keys like Insert, Home or Print Screen can also be remapped if you don't use them)

User avatar
lsemmens
Level 8
Level 8
Posts: 2339
Joined: Wed Sep 10, 2014 9:07 pm
Location: Rural South Australia

Re: Key remapping

Post by lsemmens » Sun May 05, 2019 5:47 pm

Somehow I managed to disable my numeric keypad and it's only taken a couple of hours of poking and prodding to find that Shift + Numlock enables the pointer keys and they remain enabled even when that option is no longer selected.

Now I've solved that little conundrum, I shall return to my main issue. re-mapping the [ key.:D
Kernel: 4.15.0-46-generic x86_64 bits
Desktop: Cinnamon 3.8.9
Distro: Linux Mint 19 Tara

Laptop HP-ProBook-470-G2 8Gb RAM SSD
Server AMD Phenom 9650 - GEForce 9400GT 6Gb RAM
+ three other Mint machines
Out of my mind - please leave a message

User avatar
lsemmens
Level 8
Level 8
Posts: 2339
Joined: Wed Sep 10, 2014 9:07 pm
Location: Rural South Australia

Re: Key remapping

Post by lsemmens » Sun May 05, 2019 5:51 pm

magnus7 wrote:
Sun May 05, 2019 9:04 am
Which keyboard layout do you want to modify?
Which symbols do you want to add and in what positions? (keys like Insert, Home or Print Screen can also be remapped if you don't use them)
I do use all of those keys so was thinking more along the lines of re-mapping [ to the shifted position of ] as I almost never use curly brackets. Otherwise, the windoze key is another possibility.
Kernel: 4.15.0-46-generic x86_64 bits
Desktop: Cinnamon 3.8.9
Distro: Linux Mint 19 Tara

Laptop HP-ProBook-470-G2 8Gb RAM SSD
Server AMD Phenom 9650 - GEForce 9400GT 6Gb RAM
+ three other Mint machines
Out of my mind - please leave a message

User avatar
lsemmens
Level 8
Level 8
Posts: 2339
Joined: Wed Sep 10, 2014 9:07 pm
Location: Rural South Australia

Re: Key remapping

Post by lsemmens » Sun May 05, 2019 6:26 pm

I tried this by mapping [ to ` and all I did was bork my keyboard all together, can no longer type ANYTHING on the keyboard.
The system threw up an xkb error message which I was going to copy and post but, of course with no keyboard, cannot type anything.
Then I had the bright idea of using the virtual keyboard. NO SUCH LUCK! Cinnamon decided that now was a good time to crash and not recover, at all! So, here I am in a live session preparing to back up everything and re- install. See you all in about 20 minutes. (I hope)

Code: Select all

sudo sed -i '29s|.*|key<{,[>{[`,~]};|' \
/usr/share/X11/xkb/symbols/pc \
&& sudo dpkg-reconfigure xkb-data
Kernel: 4.15.0-46-generic x86_64 bits
Desktop: Cinnamon 3.8.9
Distro: Linux Mint 19 Tara

Laptop HP-ProBook-470-G2 8Gb RAM SSD
Server AMD Phenom 9650 - GEForce 9400GT 6Gb RAM
+ three other Mint machines
Out of my mind - please leave a message

User avatar
lsemmens
Level 8
Level 8
Posts: 2339
Joined: Wed Sep 10, 2014 9:07 pm
Location: Rural South Australia

Re: Key remapping

Post by lsemmens » Sun May 05, 2019 11:53 pm

My keyboard is now back to normal and firefox is even working as intended! I've remapped caps lock using the keyboard customisation in System Settings. Did I muck up the syntax of

Code: Select all

sudo sed -i '29s|.*|key<{,[>{[`,~]};|' \
/usr/share/X11/xkb/symbols/pc \
&& sudo dpkg-reconfigure xkb-data
given that it remapped my keyboard AND Cinnamon out of existence.

All I want to do is remap {,[ key to the `~ key.
Kernel: 4.15.0-46-generic x86_64 bits
Desktop: Cinnamon 3.8.9
Distro: Linux Mint 19 Tara

Laptop HP-ProBook-470-G2 8Gb RAM SSD
Server AMD Phenom 9650 - GEForce 9400GT 6Gb RAM
+ three other Mint machines
Out of my mind - please leave a message

magnus7
Level 3
Level 3
Posts: 169
Joined: Sat Jan 30, 2016 8:46 pm

Re: Key remapping

Post by magnus7 » Mon May 06, 2019 7:09 am

lsemmens wrote:
Sun May 05, 2019 11:53 pm
Did I muck up the syntax (...) given that it remapped my keyboard AND Cinnamon out of existence.
Yes, totally. :lol:
lsemmens wrote:
Sun May 05, 2019 11:53 pm
All I want to do is remap {,[ key to the `~ key.
To confirm, you want to replace symbol ` with [?

What is the name of you keyboard layout? You can find it in Keyboard > Layouts

User avatar
lsemmens
Level 8
Level 8
Posts: 2339
Joined: Wed Sep 10, 2014 9:07 pm
Location: Rural South Australia

Re: Key remapping

Post by lsemmens » Mon May 06, 2019 8:11 am

Thanks mate,
Correct I need to remap [ to ` as I almost never use ` but [ is used in BB code all the time.
English(Australian).
Kernel: 4.15.0-46-generic x86_64 bits
Desktop: Cinnamon 3.8.9
Distro: Linux Mint 19 Tara

Laptop HP-ProBook-470-G2 8Gb RAM SSD
Server AMD Phenom 9650 - GEForce 9400GT 6Gb RAM
+ three other Mint machines
Out of my mind - please leave a message

magnus7
Level 3
Level 3
Posts: 169
Joined: Sat Jan 30, 2016 8:46 pm

Re: Key remapping

Post by magnus7 » Mon May 06, 2019 8:48 am

Code: Select all

sudo sed -i '6s|.*|key<TLDE>{[bracketleft,asciitilde]};|' \
/usr/share/X11/xkb/symbols/us \
&& sudo dpkg-reconfigure xkb-data
... and restart the computer.

User avatar
lsemmens
Level 8
Level 8
Posts: 2339
Joined: Wed Sep 10, 2014 9:07 pm
Location: Rural South Australia

Re: Key remapping

Post by lsemmens » Mon May 06, 2019 11:05 pm

Thanks Mate, I'll get the innards of Linux one day! :)
Kernel: 4.15.0-46-generic x86_64 bits
Desktop: Cinnamon 3.8.9
Distro: Linux Mint 19 Tara

Laptop HP-ProBook-470-G2 8Gb RAM SSD
Server AMD Phenom 9650 - GEForce 9400GT 6Gb RAM
+ three other Mint machines
Out of my mind - please leave a message

User avatar
lsemmens
Level 8
Level 8
Posts: 2339
Joined: Wed Sep 10, 2014 9:07 pm
Location: Rural South Australia

Re: Key remapping

Post by lsemmens » Mon May 06, 2019 11:17 pm

magnus7 wrote:
Mon May 06, 2019 8:48 am

Code: Select all

sudo sed -i '6s|.*|key<TLDE>{[bracketleft,asciitilde]};|' \
/usr/share/X11/xkb/symbols/us \
&& sudo dpkg-reconfigure xkb-data
... and restart the computer.
You, Sir, are a legend, thank you!!
Kernel: 4.15.0-46-generic x86_64 bits
Desktop: Cinnamon 3.8.9
Distro: Linux Mint 19 Tara

Laptop HP-ProBook-470-G2 8Gb RAM SSD
Server AMD Phenom 9650 - GEForce 9400GT 6Gb RAM
+ three other Mint machines
Out of my mind - please leave a message

User avatar
lsemmens
Level 8
Level 8
Posts: 2339
Joined: Wed Sep 10, 2014 9:07 pm
Location: Rural South Australia

Re: Key remapping <UN - SOLVED>

Post by lsemmens » Thu Sep 05, 2019 12:13 am

ignore this! - I forgot to restart after re-doing the map
I AM brain damaged, that's my excuse, and I'm sticking to it! :D
After the last Kernel update, my keymaps have broken and

Code: Select all

sudo sed -i '6s|.*|key<TLDE>{[bracketleft,asciitilde]};|' \
/usr/share/X11/xkb/symbols/us \
&& sudo dpkg-reconfigure xkb-data
does not seem to work now

Code: Select all

System:
  Host: leigh-HP-ProBook-470-G2 Kernel: 4.15.0-60-generic x86_64 bits: 64 
  compiler: gcc v: 7.4.0 Desktop: Cinnamon 4.2.3 
  Distro: Linux Mint 19.2 Tina base: Ubuntu 18.04 bionic 
Machine:
  Type: Laptop System: Hewlett-Packard product: HP ProBook 470 G2 
  v: A3009DD10303 serial: <filter> 
  Mobo: Hewlett-Packard model: 2249 v: KBC Version 67.24 serial: <filter> 
  BIOS: Hewlett-Packard v: M74 Ver. 01.09 date: 01/26/2015 
Battery:
  ID-1: BAT0 charge: 46.5 Wh condition: 46.5/46.5 Wh (100%) 
  model: Hewlett-Packard Primary status: Full 
CPU:
  Topology: Dual Core model: Intel Core i5-4210U bits: 64 type: MT MCP 
  arch: Haswell rev: 1 L2 cache: 3072 KiB 
  flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 19155 
  Speed: 888 MHz min/max: 800/2700 MHz Core speeds (MHz): 1: 798 2: 798 
  3: 798 4: 798 
Graphics:
  Device-1: Intel Haswell-ULT Integrated Graphics vendor: Hewlett-Packard 
  driver: i915 v: kernel bus ID: 00:02.0 
  Device-2: AMD Topaz PRO [Radeon R5 M255] vendor: Hewlett-Packard 
  driver: amdgpu v: kernel bus ID: 0a:00.0 
  Display: x11 server: X.Org 1.19.6 driver: amdgpu,ati,modesetting 
  unloaded: fbdev,vesa resolution: 1600x900~60Hz 
  OpenGL: renderer: Mesa DRI Intel Haswell Mobile v: 4.5 Mesa 19.0.8 
  direct render: Yes 
Audio:
  Device-1: Intel Haswell-ULT HD Audio vendor: Hewlett-Packard 
  driver: snd_hda_intel v: kernel bus ID: 00:03.0 
  Device-2: Intel 8 Series HD Audio vendor: Hewlett-Packard 
  driver: snd_hda_intel v: kernel bus ID: 00:1b.0 
  Sound Server: ALSA v: k4.15.0-60-generic 
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet 
  vendor: Hewlett-Packard driver: r8169 v: 2.3LK-NAPI port: 4000 
  bus ID: 08:00.0 
  IF: enp8s0 state: down mac: <filter> 
  Device-2: Broadcom and subsidiaries BCM43228 802.11a/b/g/n driver: wl 
  v: kernel port: 4000 bus ID: 09:00.0 
  IF: wlo1 state: up mac: <filter> 
Drives:
  Local Storage: total: 119.24 GiB used: 56.67 GiB (47.5%) 
  ID-1: /dev/sda vendor: Samsung model: SSD 850 PRO 128GB size: 119.24 GiB 
Partition:
  ID-1: / size: 116.87 GiB used: 56.67 GiB (48.5%) fs: ext4 dev: /dev/sda1 
Sensors:
  System Temperatures: cpu: 43.0 C mobo: 0.0 C gpu: amdgpu temp: 43 C 
  Fan Speeds (RPM): N/A 
Info:
  Processes: 230 Uptime: 1d 4h 52m Memory: 7.20 GiB used: 3.97 GiB (55.1%) 
  Init: systemd runlevel: 5 Compilers: gcc: 7.4.0 Shell: bash v: 4.4.20 
  inxi: 3.0.32 
Kernel: 4.15.0-46-generic x86_64 bits
Desktop: Cinnamon 3.8.9
Distro: Linux Mint 19 Tara

Laptop HP-ProBook-470-G2 8Gb RAM SSD
Server AMD Phenom 9650 - GEForce 9400GT 6Gb RAM
+ three other Mint machines
Out of my mind - please leave a message

magnus7
Level 3
Level 3
Posts: 169
Joined: Sat Jan 30, 2016 8:46 pm

Re: Key remapping <SOLVED - again>

Post by magnus7 » Thu Sep 05, 2019 8:07 am

On 2019-09-02 an update of xkb-data package reversed mappings to defaults. Kernel update is innocent. :D

Post Reply

Return to “Cinnamon”