Hi
bookwormep, just a couple of things to point out
You could build
/usr/ports/x11/numlockx.
Edit: For
x11/numlockx to launch at boot, you could include this on a start script. In my case, I type a command-line:
Code:
$ numlockx >/dev/null 2>1&
actually
> /dev/null 2>1&
redirects the
$stderr that
/dev/null discards to a file named
'1' inside
$HOME. Putting a
'&' before 1 instead, identifies '1' as a file descriptor,
$stdout.
According to
numlockx(1), a simple
numlockx &
would only fork a numlockx process into background, leaving the numeric keypad behavior unchanged; if you instead pass a
on
option afterwards, program locks arrow keypad to numeric function effectively. I've never tried to check the difference out though. Anyway, something like:
Code:
#!/bin/sh
if [ -x /usr/local/bin/numlockx ]; then
/usr/local/bin/numlockx on > /dev/null 2>&1 &
fi
Placed in
.xinitrc or any Xorg startup script, should do the job; I think however redirecting $stderr /dev/null could be avoided, as I've never seen
numlockx
returning a single error so far.
marcus123 yes,
x11/numlockx works only with Xorg, so were you even to add it to a custom service inside
/usr/local/etc/rc.d to be started at boot, it wouldn't take effect until you start Xorg.
On GNU/Linux one can use
stleds(1), to create a startup service managing numeric keypad behavior, like that:
Code:
#!/bin/bash
for tty in /dev/tty{1..9}
do
/usr/bin/setleds -D +num < "$tty";
done
However
setleds
is not available among freshports, and I've searched for an analogue function in
kbdcontrol(1), without luck. Anyway,
$nlock is usually mapped at function key 69 for and I've never seen it fail. So long story short, just press numlock.
The standard functions associated to Numeric keypad keys are numbered as follows (in US keyboard):
Code:
Up_arrow key 50
Page_Up key 51
(keypad) - key 52
Left _arrow key 53
(keypad) 5 key 54
Right_arrow key 55
(keypad) + key 56
End key 57
Down_arrow key 58
Page_down key 59
The way those keys are mapped is summarized in the keymap located inside
/usr/share/vt/keymaps. Under column
"base"
(standard behavior) number from 50 to 59 correspond to
fkey[0-9]
, which are the ones listed above. If numlock is pressed keys behave like numeric keys, regardless of the modifier they're pressed in conjunction with, an this can be seen on the columns following on the right. The
lock
valuefor keys from 50 to 59 is set to
'N'
meaning that numlock manages the state of those keys (standard and alternative behavior). Probably tweaking with one's own country keymap (after
backing it up) should do the job; to test a keymap you can use:
kbdcontrol -l <keymap_file>
However, being those special function keys, task may be more complicate, potentially requiring reprogramming
keyboard(4) kernel driver, and personally speaking, it way out of the range of my capabilities