Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: JustCause on October 27, 2010, 06:23:56 pm

Title: Hardware problem, getKey glitch, or fail?
Post by: JustCause on October 27, 2010, 06:23:56 pm
Code: [Select]
:Repeat getKey(1) and getKey(2) and getKey(3) and getKey(4) and getKey(43)
:End
The loop is exited not only on (all arrows) + S, but on (all arrows) + X. And it confuses me. Am I doing something wrong? Is this a glitch? Or is my calc just broken? ???
Title: Re: Hardware problem, getKey glitch, or fail?
Post by: tloz128 on October 27, 2010, 06:24:54 pm
is this basic or axe?
Title: Re: Hardware problem, getKey glitch, or fail?
Post by: yunhua98 on October 27, 2010, 06:25:27 pm
I think it's supposed to be:

Code: [Select]
:Repeat getKey(1) and (getKey(2) and (getKey(3) and (getKey(4) and (getKey(43)
:End

although I'm not sure why. ;)
Title: Re: Hardware problem, getKey glitch, or fail?
Post by: nemo on October 27, 2010, 06:26:50 pm
it's a hardware glitch. your code is fine. there really isn't much you can do about it, and i forget how someone explained it to me, but basically keys close to each other are grouped together, and so sometimes they intercept each other accidentally. the arrow keys are mapped separately so you don't see this problem with them.
Title: Re: Hardware problem, getKey glitch, or fail?
Post by: JustCause on October 27, 2010, 06:27:20 pm

I have tried that too. No luck. Also, I'm on Axe 0.4.4.

E: Ninja'd. Thx Nemo. Any idea of which keys are grouped?
Title: Re: Hardware problem, getKey glitch, or fail?
Post by: tloz128 on October 27, 2010, 06:29:36 pm
well you could try this
Code: [Select]
:Repeat (getKey(1)) and (getKey(2)) and (getKey(3)) and (getKey(4)) and (getKey(43))
:End

EDIT: nvm Nemo's got it covered
Title: Re: Hardware problem, getKey glitch, or fail?
Post by: nemo on October 27, 2010, 06:30:34 pm
justcause, no i don't know exactly which keys. generally the keys of the alpha-region (A-Z) have issues with detecting
Title: Re: Hardware problem, getKey glitch, or fail?
Post by: JustCause on October 27, 2010, 06:31:00 pm
in other words, all the keys except arrows? LOL kthx
Title: Re: Hardware problem, getKey glitch, or fail?
Post by: nemo on October 27, 2010, 06:32:58 pm
yeah pretty much. i mean it's a random occurence, so it's not going to happen all the time but if you're writing a text input routine and when you press a letter, a different letter shows up, you know why.
Title: Re: Hardware problem, getKey glitch, or fail?
Post by: JustCause on October 27, 2010, 06:39:23 pm
Oh.

...well that makes me sad :(

Thanks nemo!
Title: Re: Hardware problem, getKey glitch, or fail?
Post by: thepenguin77 on October 27, 2010, 06:53:04 pm
Yay, I get to explain this again.

Ok, The way the keyboard works is that you have the keys lined up on a grid. The grid is not exactly apparent the way the keys are laid out, but nonetheless it is there. To see what keys are being pressed, the calculator sends a current down one of the columns, it then sees which of the rows return the voltage. This shows the calculator which keys are being pressed.

This sounds flawless, and it usually is. But what happens when you press so many buttons that you build bridges? Here is an example:
Code: [Select]
   1  2
   |  |
1--A--B--
2--C--D--
   |  |

Let's say that you press A. When the calculator sends a voltage down column 1, row returns the current and the calculator knows that A is pressed. When you press B, the voltage from column 2 gets directed to row 1.

Now press A, B, and D. The calculator sends a voltage down column 1 which gets redirect to row 1 like normal. But the voltage also flows to B then D and then to the row 2 receptor. The calculator thinks that C is being pressed too! There's the problem.

Here (http://future_history.freehostia.com/Files/Resources/ASM/ASMin28Days/lesson/day22.html) is the table of the calculator buttons. Use it like you would use the chart above to see where your problems will arise.
Title: Re: Hardware problem, getKey glitch, or fail?
Post by: DJ Omnimaga on October 28, 2010, 12:37:58 am
it's a hardware glitch. your code is fine. there really isn't much you can do about it, and i forget how someone explained it to me, but basically keys close to each other are grouped together, and so sometimes they intercept each other accidentally. the arrow keys are mapped separately so you don't see this problem with them.
Yeah Thepenguin77 found this a while ago (see post above me for re-explanation :D). I noticed this too while working on a 4 level grayscale demo (hardcoded grayscale, before Axe added native 4 lv grayscale support). When pressing certain keys together, it wouldn't let me move left, if I remember. It can make certain games hard to design. X.x
Title: Re: Hardware problem, getKey glitch, or fail?
Post by: JustCause on October 28, 2010, 08:45:55 am
That helps a LOT. Thanks everyone!
Title: Re: Hardware problem, getKey glitch, or fail?
Post by: ztrumpet on October 28, 2010, 05:44:46 pm
I made this program: http://ourl.ca/7652
This can be used to check for conflicts more visually than the table. ;D
Title: Re: Hardware problem, getKey glitch, or fail?
Post by: DJ Omnimaga on October 28, 2010, 05:47:21 pm
Yeah I just saw it, thanks a lot for this :)