Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Control keys odd behaviour

This thread is locked; no one can reply to it. rss feed Print
Control keys odd behaviour
picnic
Member #14,632
October 2012
avatar

I've just noticed that hitting either control key twice makes my kb lights flash and prevents any further reading from the keyboard until I press escape. I'm not checking the status of either control key (or any other special key) in my program.

If I insert a line to check the R control key...

if event.keyboard.keycode = ALLEGRO_KEY_RCTRL then...

...it doesn't seem to recognise it.

All other keys are working as normal. Any idea what might be the cause?

I'm using Allegro.pas, latest version of Allegro itself and Freepascal on a Linux Mint 17.2 box.

Cheers

Paul.

Chris Katko
Member #1,881
January 2002
avatar

Since you're on Linux, I would check xev and confirm that both keys show up in X11 as separate keys.

It's possible you have a keymap that is merging them together. That would at least rule out the OS as a culprit.

Then check allegro/examples/al_keyboard_events and try the same thing. Press both keys. That will show whether allegro sees those events. If it does then it's either Allegro.PAS, or possibly your program.

[edited for conciseness]

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

picnic
Member #14,632
October 2012
avatar

Thanks for the reply. The keys are recognised in xev as keycodes 37 and 105 but if I press either quickly in succession in the manner of a double-click I get the same blinking-lights-until-esc-pressed scenario.

Running the allegro.pas ex_keyboard_events example also shows CONTROL_L and CONTROL_R correctly but same happens if I 'double click' either.

Must be some odd hardware or OS issue I guess...

Chris Katko
Member #1,881
January 2002
avatar

picnic said:

I've just noticed that hitting either control key twice makes my kb lights flash and prevents any further reading from the keyboard until I press escape.

I don't know how I missed this... it was early when I read your post.

Does this occur when you run any other software? Because it sounds like you're hitting the keyboard into some kind of special key mode and ESC cancels it.

Is it a laptop? What kind? If not, what keyboard do you have?

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

picnic
Member #14,632
October 2012
avatar

I found out what the problem is .... my KVM switch <blush>

http://www.techrepublic.com/forums/discussions/problems-with-a-kvm-switch-and-the-ctrl-key/

I wasn't even aware there were any hotkeys for it, probably because there was no manual etc with it.

Thanks anyway :D

Go to: