Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 04:43 27 Nov 2024 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 : Control Key

Author Message
Juri74

Senior Member

Joined: 06/02/2012
Location: Italy
Posts: 162
Posted: 04:23am 17 Feb 2013
Copy link to clipboard 
Print this post

i looked through topics but i didn't found nothing useful, my question is simple:
is it possible to check if the control key is pressed? val(inkey$) does not give significant value if control key alone is pressed...

Juri
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 07:03am 17 Feb 2013
Copy link to clipboard 
Print this post

My MM is on the operation table. :)
You could try:
KEYDOWN
Return the decimal ASCII value of the PS2 keyboard key that is
currently held down or zero if no key is down. The decimal values for
the function and arrow keys are listed in Appendix F.
Note that this function will only work with the attached PS2 keyboard
and the character will still be entered into the input keyboard buffer
(including repeated characters if the key is held down long enough).

But i am not sure the Ctrl key gives a code as it is normally used as a key modifier.

Microblocks. Build with logic.
 
MM_Wombat
Senior Member

Joined: 12/12/2011
Location: Australia
Posts: 139
Posted: 01:59pm 17 Feb 2013
Copy link to clipboard 
Print this post

Hi Juri,

The control key is, as TZA said, a modifier key..

I ran this little program

do
temp$=inkey$
if temp$<>"" then
? asc(temp$)
endif
loop

I also used "print keydown" inside a do-loop...

When I pressed the control key by itself, nothing appeared on the screen, but when I pressed control-a I got a 1, control-b a 2, control-c ended the program for obvious reasons.. Shift and windoze keys work the same... alt is asc of 139

DennisEdited by MM_Wombat 2013-02-19
Keep plugging away, it is fun learning
But can be expensive (if you keep blowing things up).

Maximite, ColourMaximite, MM+
 
Juri74

Senior Member

Joined: 06/02/2012
Location: Italy
Posts: 162
Posted: 04:04am 18 Feb 2013
Copy link to clipboard 
Print this post

that's true but strange, because a lot of pc games use CTRL key as fire button, even with ps2 keyboards, so this key alone could be checked if pressed, maybe is a maximite basic "actual" limit...


 
Print this page


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

© JAQ Software 2024