How to re-map key combination

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
sinderel
Level 2
Level 2
Posts: 50
Joined: Fri Oct 20, 2017 5:50 am

How to re-map key combination

Post by sinderel »

I have a 60% keyboard, and I am trying to re-map the functions of some of the keys that it doesn't have; in particular, Home and End. I found in some other thread that this can be done editing the file:

Code: Select all

/usr/share/X11/xkb/symbols/pc

I looked at the file and I kind of get the syntax for remapping single keys; however, I have no clue how to map a combination of keys.

In particular, I want to remap:

<ALT> + <Left-Arrow> to Home
<ALT> + <Right-Arrow> to End

Could you help me figure out how to write those two rules?

Thanks!
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
magnus7
Level 4
Level 4
Posts: 359
Joined: Sat Jan 30, 2016 8:46 pm

Re: How to re-map key combination

Post by magnus7 »

It will be easy to remap as:

<Shift> + <Left-Arrow> to Home
<Shift> + <Right-Arrow> to End

Replace lines:

Code: Select all

key <LEFT> {	[  Left		]	};
key <RGHT> {	[  Right	]	};
With:

Code: Select all

key <LEFT> {	[  Left, Home	]	};
key <RGHT> {	[  Right, End	]	};
Restart the computer.
rickNS
Level 9
Level 9
Posts: 2968
Joined: Tue Jan 25, 2011 11:59 pm

Re: How to re-map key combination

Post by rickNS »

magnus7 wrote: Sun Nov 28, 2021 8:31 am It will be easy to remap as:

<Shift> + <Left-Arrow> to Home
<Shift> + <Right-Arrow> to End

Replace lines:

Code: Select all

key <LEFT> {	[  Left		]	};
key <RGHT> {	[  Right	]	};
With:

Code: Select all

key <LEFT> {	[  Left, Home	]	};
key <RGHT> {	[  Right, End	]	};
Restart the computer.
Thanks for that magnus7. Certainly looks easier than a couple of pages I looked at.
Anyway, I don't need this particular change, but if you don't mind a related question...

Does the Left / Right keys still function normally when used without the modifier <Shift> ?
Also since the "Sys_Req" key is also missing from many modern keyboards, could a similar change make that work ?
Mint 20.0, and 21.0 MATE on Thinkpads, 3 X T420, T450, T470, and X200
magnus7
Level 4
Level 4
Posts: 359
Joined: Sat Jan 30, 2016 8:46 pm

Re: How to re-map key combination

Post by magnus7 »

rickNS wrote: Sun Nov 28, 2021 2:01 pm Does the Left / Right keys still function normally when used without the modifier <Shift> ?
Yes.

I don't think Sys_Req function can be remapped. It is in some way connected to BIOS.

Modern keyboards PrtScr keys have Sys_Req function.
Locked

Return to “Other topics”