Speculated Input.KeyDown Problem
Author |
Message |
Dragon20942
![](http://compsci.ca/v3/uploads/user_avatars/17452741294d1f674ad0f2f.jpg)
|
Posted: Sun Jun 08, 2014 6:02 pm Post subject: Speculated Input.KeyDown Problem |
|
|
What is it you are trying to achieve?
I have created a program that successfully outputs the ordinal values of different characters. However, there is an interesting thing that I noticed that I would like explained.
What is the problem you are having?
. There seems to be a maximum number of keys that are registered as pressed a one given time. This number also seems to vary based on which keys are pressed. For example, if I press 'a','s','d','f', and '3' in combination, only 'a','d', and '3' might appear on the screen. If I let go of 'd', I might be able to put both 's' and 'd' in as well. However, these combinations seem to be constant. The page on Input.KeyDown explains that detection is minimum two keys in conjunction with shift, ctrl, and alt, but if it were possible, I would like to devise specific combinations of keys which have the highest simultaneous registering.
Describe what you have tried to solve this problem
I tried adding the values, and looking up Input.KeyDown.
I also tried to do some experimentation:
Example:
a s d f j k l ; p will all register simultaneously
a s v b works, but a s b v will not let v register
Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
<Answer Here>
Turing: |
View.Set ("offscreenonly")
var chars : array char of boolean
var pressed : array 0 .. 255 of boolean
for i : 0 .. 255
pressed (i ) := false
end for
loop
Input.KeyDown (chars )
for i : 0 .. 255
if chars (chr (i )) then
put chr (i ), " -> ", i
else
pressed (i ) := false
end if
end for
View.Update
delay (5)
cls
end loop
|
Please specify what version of Turing you are using
4.1.1 |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Dreadnought
|
Posted: Sun Jun 08, 2014 6:28 pm Post subject: Re: Speculated Input.KeyDown Problem |
|
|
The problem actually has to do with the physical keyboard (try using different keyboards and see if you get different results).
I believe this is called key rollover. Basically the ability of a keyboard to properly detect multiple keys being pressed at once.
EDIT: can't get url to work (maybe I'm forgetting how to do this...) look it up for more info. ![Smile Smile](http://compsci.ca/v3/images/smiles/icon_smile.gif) |
|
|
|
|
![](images/spacer.gif) |
Raknarg
![](http://compsci.ca/v3/uploads/user_avatars/3745510004d8be6689b92f.jpg)
|
Posted: Sun Jun 08, 2014 7:54 pm Post subject: RE:Speculated Input.KeyDown Problem |
|
|
Neat little turing trick:
The keyword "char" isn't magic, it actually means a range containing all char values. So when you say array char of boolean, you're actually creating an array where the range is all the characters, and each index is a different character. I've discovered Turing actually has some cool set and range properties |
|
|
|
|
![](images/spacer.gif) |
Dragon20942
![](http://compsci.ca/v3/uploads/user_avatars/17452741294d1f674ad0f2f.jpg)
|
Posted: Sun Jun 08, 2014 7:58 pm Post subject: RE:Speculated Input.KeyDown Problem |
|
|
Yeah, key rollover seems like the problem, thanks! It looks like to actually have a foolproof method of determining which combinations of keys work, you have to download detector software |
|
|
|
|
![](images/spacer.gif) |
|
|