Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 19:52 16 Nov 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Question about keyboard input

Author Message
RCMAN
Newbie

Joined: 31/10/2020
Location: Canada
Posts: 29
Posted: 03:36pm 06 Dec 2020
Copy link to clipboard 
Print this post

Hello,

I'm writing a shooting game and I find the CMM2 doesn't accept multiple key presses at the same time.

If I want to control ship movement and press fire at the same time I need to stop moving my ship for it to register another key.

Is there an interupt driven way I can get keyboard input?

I have used keydown and inkey$ and neither seem to allow multiple.

Thanks
RC
 
NPHighview

Senior Member

Joined: 02/09/2020
Location: United States
Posts: 213
Posted: 03:48pm 06 Dec 2020
Copy link to clipboard 
Print this post

I've noticed this as well; "N-key" rollover doesn't work very well on the CMM2.  You can detect a few combination keypresses (Ctrl-arrow keys) in particular, but that's pretty much it.  But, with today's release with Peter working on USB keyboard "up key" detection, it may be worth revisiting.

I wrote a little keyboard monitoring program to display all seven or eight of the values in the keydown() array, and took notes on what key combos work.  This should be pretty easy to replicate (I'm not at my development computer right now).
Live in the Future. It's Just Starting Now!
 
RCMAN
Newbie

Joined: 31/10/2020
Location: Canada
Posts: 29
Posted: 04:09pm 06 Dec 2020
Copy link to clipboard 
Print this post

  NPHighview said  I've noticed this as well; "N-key" rollover doesn't work very well on the CMM2.  You can detect a few combination keypresses (Ctrl-arrow keys) in particular, but that's pretty much it.  But, with today's release with Peter working on USB keyboard "up key" detection, it may be worth revisiting.

I wrote a little keyboard monitoring program to display all seven or eight of the values in the keydown() array, and took notes on what key combos work.  This should be pretty easy to replicate (I'm not at my development computer right now).



I have tried left control and it would not show me anything. I'm not sure why.

I have a similar program that just shows values. I read in the Beta 1 of the firmware this might have been addressed but I have not confirmed.

RC
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10589
Posted: 04:27pm 06 Dec 2020
Copy link to clipboard 
Print this post

keydown works perfectly within the limitations of the keyboard itself. Keyboards use a matrix scan and depending on where keys are in the matrix they may or may not be able to appear simultaneously

Run the attached to see what your keyboard can do and read the manual for what to expect

do
print @(0,0),str$(keydown(0),4), str$(keydown(1),4),str$(keydown(2),4),str$(keydown(3),4),str$(keydown(4),4),str$(keydown(5),4),str$(keydown(6)),bin$(keydown(7),8)
loop

Edited 2020-12-07 02:27 by matherp
 
RCMAN
Newbie

Joined: 31/10/2020
Location: Canada
Posts: 29
Posted: 04:39pm 06 Dec 2020
Copy link to clipboard 
Print this post

  matherp said  keydown works perfectly within the limitations of the keyboard itself. Keyboards use a matrix scan and depending on where keys are in the matrix they may or may not be able to appear simultaneously

Run the attached to see what your keyboard can do and read the manual for what to expect

do
print @(0,0),str$(keydown(0),4), str$(keydown(1),4),str$(keydown(2),4),str$(keydown(3),4),str$(keydown(4),4),str$(keydown(5),4),str$(keydown(6)),bin$(keydown(7),8)
loop


Thank you. That solved the issue.

RC
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025