Author Topic: [Ndless] Multi-arrow keys detection problem  (Read 5397 times)

0 Members and 1 Guest are viewing this topic.

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
[Ndless] Multi-arrow keys detection problem
« on: May 04, 2014, 03:12:20 pm »
Hola,

So that one is a first for me. I have one program, and nspire_emu only detects multi-arrow-keys presses if it's emulating a non-CX Nspire. If it's emulating a CX one, the last pressed key overwrites the preceding one (like, if I hold right then press up, it'll only understand up).

At first I thought that was only nspire_emu, but testing on real HW from a TI-Planet member (I only have a Nspire CAS, on which it worked well) told me that that wasn't nspire_emu.

So I finally thought that was because of the touchpad (again, some may say). That's what I currently have :

Code: [Select]
typedef int KeyEvent; // because cleanliness
inline KeyEvent getk(void)
{
    return (((isKeyPressed(KEY_NSPIRE_UP) << 1) + isKeyPressed(KEY_NSPIRE_RIGHT) << 1) + isKeyPressed(KEY_NSPIRE_LEFT) << 1) + isKeyPressed(KEY_NSPIRE_DOWN);
}

I wrote a small debug wrapper for you to test if you wish :

Code: [Select]
typedef int KeyEvent;
KeyEvent getk(void)
{
    int i;
    KeyEvent k;
    while(!isKeyPressed(KEY_NSPIRE_ENTER))
    {
        k = (((isKeyPressed(KEY_NSPIRE_UP) << 1) + isKeyPressed(KEY_NSPIRE_RIGHT) << 1) + isKeyPressed(KEY_NSPIRE_LEFT) << 1) + isKeyPressed(KEY_NSPIRE_DOWN);
        for(i = 3; i >= 0; i--)
            printf("%d", (k >> i) & 1);
        printf("\n");
        SDL_Delay(1000);
    }
    return k;
}
Look at the console while you press keys ; [enter] to quit.

Any idea ?
« Last Edit: May 04, 2014, 03:18:24 pm by Matrefeytontias »

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: [Ndless] Multi-arrow keys detection problem
« Reply #1 on: May 04, 2014, 03:18:02 pm »
Does it also not work on touchpad monochrome calcs ?
Also since the touchpad isn't multi touch you can't detect two arrows, but you can still detect diagonals.

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [Ndless] Multi-arrow keys detection problem
« Reply #2 on: May 04, 2014, 03:20:56 pm »
Well I guess it won't work although I can't really test, I'm only left with a TI-Nspire CAS clickpad and a TI-Nspire CX CAS (thus touchpad) ROM, and switching keyboards within nspire_emu will make arrow keys non-working within the emu.

I also tried reading diagonals with KEY_NSPIRE_LEFTUP and such, but that didn't work either.
« Last Edit: May 04, 2014, 03:23:53 pm by Matrefeytontias »

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: [Ndless] Multi-arrow keys detection problem
« Reply #3 on: May 04, 2014, 03:23:08 pm »
IIRC the clickpad calcs are compatible with touchpad keyboards though. :/

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [Ndless] Multi-arrow keys detection problem
« Reply #4 on: May 04, 2014, 03:24:36 pm »
Yeah that's what I thought, so it's really weird ; morever I never had this problem before switching to Ndless 3.1 r914 (my CAS prototype must stay with OS 3.1).

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: [Ndless] Multi-arrow keys detection problem
« Reply #5 on: May 04, 2014, 03:27:39 pm »
Oh nice you have a proto calc. :D

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [Ndless] Multi-arrow keys detection problem
« Reply #6 on: May 04, 2014, 03:31:45 pm »
Yeah well it's not serving me pretty well for instance >_>

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: [Ndless] Multi-arrow keys detection problem
« Reply #7 on: July 23, 2014, 08:28:33 am »
I also noticed this, and it caused me to try designing other control schemes. I have not yet been able to come up with something good though. Thing is you need those diagonals in most games, and diagonals on the keypad = hurts thumbs. I think it's best to try using the keyboard as d-pad but not 100% sure yet. Also I'm fairly sure gbc4nspire supports multi arrow keys with keypad, so I'm not sure what causes this :/
I'm not a nerd but I pretend:

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [Ndless] Multi-arrow keys detection problem
« Reply #8 on: July 23, 2014, 10:26:57 am »
I forgot to update the topic, but it's actually the latest nspire_emu's fault, since from what those with a CX told me diagonals work fine (see nKaruga).