numpad keys as the same non numpad keys

X.Org on FreeBSD installation & configuration.

numpad keys as the same non numpad keys

Postby freethread » 31 Oct 2011, 17:40

Is there a way to use numpad keys as the related non-numpad keys? That is, the ARROWS, PGUP, PGDN, HOME, END, INS, DEL on a desktop keyboard.

My desktop env is Xfce and I prefer stick with it. I know ther's an option in Gnome keyboard that do this trik, but never tested if it really works. In Xorg configuration there is an option
Code: Select all
Option "XkbOption" "numpad:microsoft"

I found it somewhere on the Net and inserted it in [FILE]xorg.conf[/FILE], it seem doesn't works.

I installed Xorg without Hal, but some port use it (gnome-mount, Thunar and few others, I'm working for remove it), anyways Xorg doesn't depend on it so the option should works, or perhaps it's wrong typed.

Anyone know if there is a solution? I run in troubles editing text, some habits are hard to die.
User avatar
freethread
Member
 
Posts: 271
Joined: 18 Aug 2009, 00:43
Location: italy

Postby ikreos » 31 Oct 2011, 18:28

Is there any reason you can't turn NumLock off?
"I reject your reality and substitute my own!" -- Adam Savage, Mythbusters
iBlast! I use vi so much I keep wanting to enter commands when I type in a forum!<ESC>:wAGah!
Proud user of the FreeBSD Operating System. http://www.FreeBSD.org/
User avatar
ikreos
Junior Member
 
Posts: 80
Joined: 12 Mar 2011, 03:40
Location: Stuck between subatomic particles in quantum space.

Postby freethread » 31 Oct 2011, 19:06

ikreos wrote:Is there any reason you can't turn NumLock off?


lol, I don't know how you can see the numlock led on my keyboard, anyways it's turned off.
I will explain the problem in more detail.

For 'cut', 'copy' and 'paste' command I use respectively 'shift+del', 'ctrl+ins', 'shift+ins', I use them from about 25 years, moreover X Windows is not the graphic environment I usually use. The numeric pad always work as cursor movement and not numeric keys (so nuklock is turned off). If you try to type 'ctrl+ins' (INSERT on numpad), nothing happens in Xfce and in more general all X desktop envs. When you type 'shift+ins' (INSERT on numeric pad) a '0' (zero) will be printed. I prefer the 'ctrl-ins', 'shift-ins' and 'shift-del' on numpad behave the same as on the non-numpad 'ins' and 'del'.

The same happens with selection 'shift+(arrows|home|end|pgup|pgdn)' and 'shift+ctrl+(home|end|pgup|pgdn)' in this case I use the 4 arrow keys and it works, but for home, end, pgup, pgdn I use the numpad keys. Anyhow, if there is a solution for one of the key on numpad it works for all.

As an example, some editors like Geany, Eclipse IDE and, if I remember SciTE, that key combinations are configurable.
User avatar
freethread
Member
 
Posts: 271
Joined: 18 Aug 2009, 00:43
Location: italy

Postby wblock@ » 31 Oct 2011, 21:35

This could be due to a keymap setting. On a US keyboard, the numpad keys type cursor movements unless Numlock is on.

In xfce, the Settings/Keyboard control panel will recognize numpad shift-0 as separate from shift-0. Offhand I can't recall how you can send a fake input character in
X, but I'm pretty sure it's possible. There's [pman=1]xkbcomp[/pman] and a little searching turns up [port]x11/xdotool[/port]. (Untested.)
User avatar
wblock@
Old Fart
 
Posts: 10167
Joined: 07 Sep 2009, 23:23
Location: Milky Way galaxy

Postby ikreos » 31 Oct 2011, 22:58

wblock@ wrote:This could be due to a keymap setting. On a US keyboard, the numpad keys type cursor movements unless Numlock is on.


Hence why I asked. Just thought it might be something you missed. If you use a different keymap, I apologize for the slightly rude(?) post.

freethread wrote:lol, I don't know how you can see the numlock led on my keyboard, anyways it's turned off.


Well I am stuck between subatomic particles in quantum space. :D
"I reject your reality and substitute my own!" -- Adam Savage, Mythbusters
iBlast! I use vi so much I keep wanting to enter commands when I type in a forum!<ESC>:wAGah!
Proud user of the FreeBSD Operating System. http://www.FreeBSD.org/
User avatar
ikreos
Junior Member
 
Posts: 80
Joined: 12 Mar 2011, 03:40
Location: Stuck between subatomic particles in quantum space.

Postby freethread » 01 Nov 2011, 06:03

Thanks ikreos and wblock for your advices, after a deep search on the web without success and after many test and Xfce restarts, I found a solution that works for me, perhaps it's not elegant but block a lot of swearwords.

First thing, the line I had in [FILE]xorg.conf[/FILE] was wrong, this is the right one
Code: Select all
Section "InputDevice"
    Identifier     "Keyboard0"
    ...
    Option         "XkbOption[B]s[/B]" "numpad:microsoft"
EndSection

with this line the numpad behave as expected except fot INS and DEL, they do nothing with modifiers (alt, ctrl and shift).To correct this I remapped them to the non-numpad twins insering the following lines in [FILE].xinitrc[/FILE] before starting Xfce
Code: Select all
xmodmap -e "keysym KP_Insert = Insert"
xmodmap -e "keysym KP_Delete = Delete"
exec startxfce4


Now I try to set [solved] to this thread
User avatar
freethread
Member
 
Posts: 271
Joined: 18 Aug 2009, 00:43
Location: italy


Return to X.Org

Who is online

Users browsing this forum: No registered users and 0 guests