Skip navigation.
Home
The QNX Community Portal

View topic - How to set NUMLOCK "on" in Photon

How to set NUMLOCK "on" in Photon

For the old QNX2 and QNX4 RTOS

How to set NUMLOCK "on" in Photon

Postby KBOB » Tue Jan 19, 2010 10:49 am

I need to set NUMLOCK status (not indicator led) "on" under photon.
How can I do that?

When I turn NUMLOCK "on" in BIOS on bootup, it turns down when Dev.ansi starts.

If I set NUMLOCK "on" with
stty +numlock > /dev/con1
it turns down when Photon start even if kbd start with -R optoin.

In photon I can edit keyboard tables located in /usr/photon/keyboard and set
Actions {
then press <Num_Lock>
}
this action ONLY takes plase when any Modifier pressed.
But I need set NumLock "on" unconditionaly.

How can I do this???? :cry: :cry: :cry: :cry:
KBOB
Active Member
 
Posts: 39
Joined: Mon Jul 04, 2005 9:40 am

RE: How to set NUMLOCK "on" in Photon

Postby maschoen » Tue Jan 19, 2010 4:44 pm

The problem with the led is related to the fact that the led is a physically state, but that NumLock on is a logical state controlled by the keyboard driver. Usually this driver updates the physical keyboards LED to reflect the true condition.

If you are trying to control NumLock within a single program the solution is easy, just uppercase all input. If you want NumLock always on for all processes, you could modify the driver. Just make sure that their is a way to lowercase things, eg. press Shift, unless this is a permanently embedded system with no need.

Very old hacks like me will remember that IBM mainframe line printers originally didn't always have lowercase, and somehow the world didn't come to an end. I remember when I was admonished for having run a program that had some lower case in it. The guys in the computer room had to change the chain on the printer for this to work right. They didn't like doing this because the non-lower case chain had double the letters and so it was usually twice as fast.
maschoen
QNX Master
 
Posts: 2640
Joined: Wed Jun 25, 2003 5:18 pm

Postby ingraham » Tue Jan 19, 2010 5:51 pm

There's actually a description of exactly how do this in the help for the devctl() function. It's a little obscure but it's not TOO bad. And of course you get to pretty much copy paste it out of the help. You could have a simple program that turns on Num Lock and run that program when Photon starts by putting in your phapps file.

-James Ingraham
Sage Automation, Inc.
ingraham
Senior Member
 
Posts: 160
Joined: Wed Nov 05, 2003 2:25 pm
Location: Texas

Postby KBOB » Wed Jan 20, 2010 4:20 am

Editing kdef file so that

KeyType "Keypad" {
Unmodified Sym #2
<Alt> Sym #1
<Ctrl> Sym #1
<Ctrl> + <Alt> Sym #1
<Shift> Sym #2
<Shift> + <Alt> Sym #2
<Shift> + <Ctrl> Sym #2
<Shift> + <Ctrl> + <Alt> Sym #2
<Num_Lock> Sym #2
<Num_Lock> + <Alt> NoSym
<Num_Lock> + <Ctrl> NoSym
<Num_Lock> + <Ctrl> + <Alt> NoSym
<Num_Lock> + <Shift> Sym #1
<Num_Lock> + <Shift> + <Alt> NoSym
<Num_Lock> + <Shift> + <Ctrl> NoSym
<Num_Lock> + <Shift> + <Ctrl> + <Alt> NoSym


works!
KBOB
Active Member
 
Posts: 39
Joined: Mon Jul 04, 2005 9:40 am


Return to QNX2 and QNX4

Who is online

Users browsing this forum: No registered users and 3 guests