Turning off CAPS LOCK

Is there a way to force caps lock off FOREVER ? We have a barcode
scanner connected via the keyboard port, and if the user turns on
CAPS LOCK our barcodes show up in inverse case… Any solutions?

We’re using 6.2.1 x86

Cheers,
-RK


[If replying via email, you’ll need to click on the URL that’s emailed to you
afterwards to forward the email to me – spam filters and all that]
Robert Krten, PDP minicomputer collector http://www.parse.com/~museum/

Robert Krten wrote:

Is there a way to force caps lock off FOREVER ? We have a barcode
scanner connected via the keyboard port, and if the user turns on
CAPS LOCK our barcodes show up in inverse case… Any solutions?

Cut the tracks to CAPS-LOCK in the keyboard. :wink:


Evan

Robert Krten <rk@parse.com> wrote:

Is there a way to force caps lock off FOREVER ? We have a barcode
scanner connected via the keyboard port, and if the user turns on
CAPS LOCK our barcodes show up in inverse case… Any solutions?

Pliers?

-David

David Gibbs
QNX Training Services
dagibbs@qnx.com

David Gibbs <dagibbs@qnx.com> wrote:

Robert Krten <> rk@parse.com> > wrote:
Is there a way to force caps lock off FOREVER ? We have a barcode
scanner connected via the keyboard port, and if the user turns on
CAPS LOCK our barcodes show up in inverse case… Any solutions?

Pliers?

Worked on my laptop :wink:

-David

David Gibbs
QNX Training Services
dagibbs@qnx.com

Robert Krten wrote:

Is there a way to force caps lock off FOREVER ? We have a barcode
scanner connected via the keyboard port, and if the user turns on
CAPS LOCK our barcodes show up in inverse case… Any solutions?

We’re using 6.2.1 x86

If you prefer a software solution, just remove the key from the keyboard
mapping. In the source files under /usr/photon/keyboard, it’s defined
in common.inc (search for “Caps_Lock” and remove the “Key { … }”
around it). Or, if you prefer to get rid of other stuff, too (maybe
NumLock, cursor keys, Alt compose sequences etc.), then use sample.kdef
instead – it doesn’t include anything and has comments in it that
explain the details.

Wojtek Lerch <Wojtek_L@yahoo.ca> wrote:

Robert Krten wrote:
Is there a way to force caps lock off FOREVER ? We have a barcode
scanner connected via the keyboard port, and if the user turns on
CAPS LOCK our barcodes show up in inverse case… Any solutions?

We’re using 6.2.1 x86

If you prefer a software solution, just remove the key from the keyboard
mapping. In the source files under /usr/photon/keyboard, it’s defined
in common.inc (search for “Caps_Lock” and remove the “Key { … }”
around it). Or, if you prefer to get rid of other stuff, too (maybe
NumLock, cursor keys, Alt compose sequences etc.), then use sample.kdef
instead – it doesn’t include anything and has comments in it that
explain the details.

Hmmm… forgot to mention. No Photon :frowning:

Cheers,
-RK


[If replying via email, you’ll need to click on the URL that’s emailed to you
afterwards to forward the email to me – spam filters and all that]
Robert Krten, PDP minicomputer collector http://www.parse.com/~museum/

David Donohoe <ddonohoe@bulbous.ott.qnx.com> wrote:

David Gibbs <> dagibbs@qnx.com> > wrote:
Robert Krten <> rk@parse.com> > wrote:
Is there a way to force caps lock off FOREVER ? We have a barcode
scanner connected via the keyboard port, and if the user turns on
CAPS LOCK our barcodes show up in inverse case… Any solutions?

Pliers?

Worked on my laptop > :wink:

Ouch! Seems a little radical. I can just see the step in the manufacturing
procedures manual… :slight_smile:

Cheers,
-RK


[If replying via email, you’ll need to click on the URL that’s emailed to you
afterwards to forward the email to me – spam filters and all that]
Robert Krten, PDP minicomputer collector http://www.parse.com/~museum/

Wojtek Lerch <Wojtek_L@yahoo.ca> wrote:

Robert Krten wrote:
Hmmm… forgot to mention. No Photon > :frowning:

Um… How about this: run Photon with a big full-screen pterm that
looks just like a text-mode console…

You just want to generate licensing revenues for QSSL :slight_smile: :slight_smile:

I’d just as soon avoid doing that… We don’t even use a “console” screen,
we use a 4x20 VFD (Vacuum Flourescent Display).

Cheers,
-RK


[If replying via email, you’ll need to click on the URL that’s emailed to you
afterwards to forward the email to me – spam filters and all that]
Robert Krten, PDP minicomputer collector http://www.parse.com/~museum/

Robert Krten wrote:

Hmmm… forgot to mention. No Photon > :frowning:

Um… How about this: run Photon with a big full-screen pterm that
looks just like a text-mode console…

Robert Krten wrote:

Is there a way to force caps lock off FOREVER ? We have a barcode
scanner connected via the keyboard port, and if the user turns on
CAPS LOCK our barcodes show up in inverse case… Any solutions?

We’re using 6.2.1 x86

Use a screwdriver to pop off the key? Remap CapsLock to be a Control
key, like it should be?


Chris Herborth (cherborth@qnx.com)
Never send a monster to do the work of an evil scientist.

Robert Krten wrote:

Wojtek Lerch <> Wojtek_L@yahoo.ca> > wrote:

Robert Krten wrote:

Is there a way to force caps lock off FOREVER ? We have a barcode
scanner connected via the keyboard port, and if the user turns on
CAPS LOCK our barcodes show up in inverse case… Any solutions?

We’re using 6.2.1 x86
[…]
Hmmm… forgot to mention. No Photon > :frowning:

How about fix your software so it does the right thing even if CapsLock
is down? :wink: Or is there some legitimate use for Shift-ScanBarcode?


Chris Herborth (cherborth@qnx.com)
Never send a monster to do the work of an evil scientist.

Wojtek Lerch wrote:

Robert Krten wrote:

Hmmm… forgot to mention. No Photon > :frowning:

Um… How about this: run Photon with a big full-screen pterm that
looks just like a text-mode console…

How do you think he writes the code? :wink:


Chris Herborth (cherborth@qnx.com)
Never send a monster to do the work of an evil scientist.

Chris Herborth <cherborth@qnx.com> wrote:

Wojtek Lerch wrote:
Robert Krten wrote:

Hmmm… forgot to mention. No Photon > :frowning:

Um… How about this: run Photon with a big full-screen pterm that
looks just like a text-mode console…

How do you think he writes the code? > :wink:

I have NINE full-screen pterms :slight_smile: Much more productive…

Cheers,
-RK

[If replying via email, you’ll need to click on the URL that’s emailed to you
afterwards to forward the email to me – spam filters and all that]
Robert Krten, PDP minicomputer collector http://www.parse.com/~museum/

Chris Herborth <cherborth@qnx.com> wrote:

Robert Krten wrote:
Wojtek Lerch <> Wojtek_L@yahoo.ca> > wrote:

Robert Krten wrote:

Is there a way to force caps lock off FOREVER ? We have a barcode
scanner connected via the keyboard port, and if the user turns on
CAPS LOCK our barcodes show up in inverse case… Any solutions?

We’re using 6.2.1 x86
[…]
Hmmm… forgot to mention. No Photon > :frowning:

How about fix your software so it does the right thing even if CapsLock
is down? > :wink: > Or is there some legitimate use for Shift-ScanBarcode?

Can’t be done without revalidating all the changes. Barcodes are spec’d
with upper case characters for certain things, lowercase characters for
others, and then the “other” class, which is basically free-format.
Problem is, if I accept a123456b as an American Red Cross Collection
Center code, and they have the caps lock on, it’ll show up as A123456B,
which according to the specifications is an “other” type. That said,
they’re welcome to scan A123456B and they would expect it to show up
as “other”, not as an ARC/CC code. Sigh. We already thought of that
in a meeting today. I told them about how windoze tries all the possible
upper and lowercase versions of usernames/passwords in SAMBA and we
giggled nervously and changed the subject :slight_smile:

Cheers,
-RK

[If replying via email, you’ll need to click on the URL that’s emailed to you
afterwards to forward the email to me – spam filters and all that]
Robert Krten, PDP minicomputer collector http://www.parse.com/~museum/

Or lock the CAPS key with “locktite”. One of our customers has done it!.
It’s incredible but true.

Evan Hillas wrote:

Robert Krten wrote:
Is there a way to force caps lock off FOREVER ? We have a barcode
scanner connected via the keyboard port, and if the user turns on
CAPS LOCK our barcodes show up in inverse case… Any solutions?


Cut the tracks to CAPS-LOCK in the keyboard. > :wink:

Evan

Robert Krten <rk@parse.com> wrote:

Can’t be done without revalidating all the changes. Barcodes are spec’d
with upper case characters for certain things, lowercase characters for
others, and then the “other” class, which is basically free-format.
Problem is, if I accept a123456b as an American Red Cross Collection
Center code, and they have the caps lock on, it’ll show up as A123456B,
which according to the specifications is an “other” type. That said,
they’re welcome to scan A123456B and they would expect it to show up
as “other”, not as an ARC/CC code. Sigh. We already thought of that
in a meeting today. I told them about how windoze tries all the possible
upper and lowercase versions of usernames/passwords in SAMBA and we
giggled nervously and changed the subject > :slight_smile:

Talk to someone official at QNX (not on a newsgroup) about getting access
to devc-con source, and modifying it yourself to ignore this?

Or talk to someone about doing a custom-engineering job to have us give
you a custom devc-con that will ignore the caps-lock key?

It doesn’t look like there is any software config type thing that will
work. (Sadly, this could have been done under QNX4 I think, as there
were keyboard mapping tools for text mode consoles there.)

-David

David Gibbs
QNX Training Services
dagibbs@qnx.com

David Gibbs wrote:

It doesn’t look like there is any software config type thing that will
work. (Sadly, this could have been done under QNX4 I think, as there
were keyboard mapping tools for text mode consoles there.)

But they were limited to the main, alphanumeric part of the keyboard,
weren’t they?

Wojtek Lerch <Wojtek_L@yahoo.ca> wrote:

David Gibbs wrote:
It doesn’t look like there is any software config type thing that will
work. (Sadly, this could have been done under QNX4 I think, as there
were keyboard mapping tools for text mode consoles there.)

But they were limited to the main, alphanumeric part of the keyboard,
weren’t they?

op kbd //61/etc/config/kbd/pt.kbd

mapped the ctrl key to be capslock and the capslock key to be control.

Though, oddly, kedit didn’t see to let me change those mappings, even
with that particular kbd file.

Hm.

Irrelevant to this question, though.

-David

David Gibbs
QNX Training Services
dagibbs@qnx.com

Robert Krten <rk@parse.com> wrote in message
news:ctbm88$ojq$1@inn.qnx.com

Wojtek Lerch <> Wojtek_L@yahoo.ca> > wrote:
Robert Krten wrote:
Is there a way to force caps lock off FOREVER ? We have a barcode
scanner connected via the keyboard port, and if the user turns on
CAPS LOCK our barcodes show up in inverse case… Any solutions?

We’re using 6.2.1 x86

If you prefer a software solution, just remove the key from the keyboard
mapping. In the source files under /usr/photon/keyboard, it’s defined
in common.inc (search for “Caps_Lock” and remove the “Key { … }”
around it). Or, if you prefer to get rid of other stuff, too (maybe
NumLock, cursor keys, Alt compose sequences etc.), then use sample.kdef
instead – it doesn’t include anything and has comments in it that
explain the details.

Hmmm… forgot to mention. No Photon > :frowning:

You could try devi-hirun -Pr …
Which disables Photon interface and presents a resmgr interface
/dev/devi/…
cat /dev/devi/keyboard0

But I tried it here under 6.30 and it appears this interface is not working
properly.
(entering a PR for this)






Cheers,
-RK


[If replying via email, you’ll need to click on the URL that’s emailed to
you
afterwards to forward the email to me – spam filters and all that]
Robert Krten, PDP minicomputer collector > http://www.parse.com/~museum/

Robert Krten <rk@parse.com> wrote:

Is there a way to force caps lock off FOREVER ? We have a barcode
scanner connected via the keyboard port, and if the user turns on
CAPS LOCK our barcodes show up in inverse case… Any solutions?

We’re using 6.2.1 x86

Solved, with the help of Jon Wyatt.

Basically, what I do is simply look at the caps lock key after our
barcode scanner delivers the completed barcode. Because the barcode
scanner operates very fast, there is only a tiny window after we get
the last character and before we check the caps lock status where things
could go wrong – and this would have to be done by a particularly
fast operator who was toggling the caps lock as they were scanning
barcodes; not likely in our application.

So, here’s the magic code:

static int devkbd; // file descriptor for /dev/kbd

void init (void)
{

// set up a file descriptor for the raw keyboard device
if ((devkbd = open ("/dev/kbd", O_RDONLY)) == -1) {
sl_printf ("%s %d: can’t open /dev/kbd for O_RDONLY (errno %d, %s); CAPS LOCK detect feature disabled!\n", FILE, LINE, errno, strerror (errno));
}
}

void process_barcode (char *buffer)
{

if (devkbd != -1) {
invert = 0; // by default, don’t toggle the case of characters from the barcode scanner
if (sts = devctl (devkbd, DCMD_CHR_LINESTATUS, &i, sizeof (i), NULL)) {
sl_printf ("%s %d: can’t devctl (DCMD_CHR_LINESTATUS) retval %d (%s)\n", FILE, LINE, sts, strerror (sts));
} else {
invert = !!(i & _LINESTATUS_CON_CAPS); // snap status (we’re assuming caps lock is still in the same state as when the barcode scan began)
}

if (invert) {
for (p = buffer; *p; p++) {
if (isalpha (*p)) {
if (isupper (*p)) {
*p = tolower (*p);
} else {
*p = toupper (*p);
}
}
}
}
}


}

Cheers,
-RK


[If replying via email, you’ll need to click on the URL that’s emailed to you
afterwards to forward the email to me – spam filters and all that]
Robert Krten, PDP minicomputer collector http://www.parse.com/~museum/