Author Topic: Hardware problem, getKey glitch, or fail?  (Read 7354 times)

0 Members and 1 Guest are viewing this topic.

Offline JustCause

  • CoT Emeritus
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 810
  • Rating: +115/-5
    • View Profile
Hardware problem, getKey glitch, or fail?
« 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? ???
See you, space cowboy...

Offline tloz128

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 324
  • Rating: +58/-6
  • I feel asleep.
    • View Profile
Re: Hardware problem, getKey glitch, or fail?
« Reply #1 on: October 27, 2010, 06:24:54 pm »
is this basic or axe?
Naaa... Na Nah Na Nana Na Nah... Hey Jude!

Offline yunhua98

  • You won't this read sentence right.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2718
  • Rating: +214/-12
  • Go take a dive in the River Lethe.
    • View Profile
Re: Hardware problem, getKey glitch, or fail?
« Reply #2 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. ;)

Spoiler For =====My Projects=====:
Minor setback due to code messing up.  On hold for Contest.
<hr>
On hold for Contest.


Spoiler For ===Staff Memberships===:






Have you seen any good news-worthy programs/events?  If so, PM me with an article to be included in the next issue of CGPN!
The Game is only a demo, the code that allows one to win hasn't been done.
To paraphrase Oedipus, Hamlet, Lear, and all those guys, "I wish I had known this some time ago."
Signature Last Updated: 12/26/11
<hr>

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Hardware problem, getKey glitch, or fail?
« Reply #3 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.


Offline JustCause

  • CoT Emeritus
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 810
  • Rating: +115/-5
    • View Profile
Re: Hardware problem, getKey glitch, or fail?
« Reply #4 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?
« Last Edit: October 27, 2010, 06:29:27 pm by JustCause »
See you, space cowboy...

Offline tloz128

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 324
  • Rating: +58/-6
  • I feel asleep.
    • View Profile
Re: Hardware problem, getKey glitch, or fail?
« Reply #5 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
« Last Edit: October 27, 2010, 06:30:31 pm by tloz128 »
Naaa... Na Nah Na Nana Na Nah... Hey Jude!

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Hardware problem, getKey glitch, or fail?
« Reply #6 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


Offline JustCause

  • CoT Emeritus
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 810
  • Rating: +115/-5
    • View Profile
Re: Hardware problem, getKey glitch, or fail?
« Reply #7 on: October 27, 2010, 06:31:00 pm »
in other words, all the keys except arrows? LOL kthx
See you, space cowboy...

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Hardware problem, getKey glitch, or fail?
« Reply #8 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.


Offline JustCause

  • CoT Emeritus
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 810
  • Rating: +115/-5
    • View Profile
Re: Hardware problem, getKey glitch, or fail?
« Reply #9 on: October 27, 2010, 06:39:23 pm »
Oh.

...well that makes me sad :(

Thanks nemo!
See you, space cowboy...

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: Hardware problem, getKey glitch, or fail?
« Reply #10 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 is the table of the calculator buttons. Use it like you would use the chart above to see where your problems will arise.
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Hardware problem, getKey glitch, or fail?
« Reply #11 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

Offline JustCause

  • CoT Emeritus
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 810
  • Rating: +115/-5
    • View Profile
Re: Hardware problem, getKey glitch, or fail?
« Reply #12 on: October 28, 2010, 08:45:55 am »
That helps a LOT. Thanks everyone!
See you, space cowboy...

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Hardware problem, getKey glitch, or fail?
« Reply #13 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

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Hardware problem, getKey glitch, or fail?
« Reply #14 on: October 28, 2010, 05:47:21 pm »
Yeah I just saw it, thanks a lot for this :)