π
<-
Chat plein-écran
[^]

keycodes SDL manquants pour nspire CX-II

C, C++, ASM...

keycodes SDL manquants pour nspire CX-II

Message non lude SlyVTT » 07 Fév 2021, 18:20

Hello again,

c'est la soirée des questions.

Je cherche à avoir un mapping des touches de la CX-II. En utilisant la SDL, via un SDL_event, j'arrive à obtenir un code pour la majorité des touches, mais certaines ne retournent rien (par exemple :nssc: :nsdo: :nsho: :nsbi: :nsfl: ...).

Comment faire pour obtenir le keycode correspondant ? On peut toujours attaquer via le mapping mémoire (explicité ici), mais c'est un peu bancal car les 3/4 fonctionnent avec la SDL, et les "trous" seraient comblés via le mapping mémoire : bref pas très "homogène".

Merci d'avance.

Sly
Some works in progress :
The GUI Toolkit NF for nSpireMyShmup for fxCG-50Magic Light for Casio Graph 90+E
and
Magic Light for nSpire CX/CX-II
Simple Text Editor for nSpireOutRun for Casio Graph 90+E
95%
50%
100%
75%
100%
And more to come ... stay tuned
Avatar de l’utilisateur
SlyVTTPremium
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Prochain niv.: 43%
 
Messages: 482
Images: 31
Inscription: 19 Jan 2021, 09:41
Localisation: France
Genre: Homme
Calculatrice(s):
MyCalcs profile
GitHub: SlyVTT

Re: keycodes SDL manquants pour nspire CX-II

Message non lude Vogtinator » 07 Fév 2021, 22:27

The best way is probably to somehow implement support for SDLK_UNKNOWN keys in a way that applications can use them properly:

https://github.com/Vogtinator/nSDL/blob ... nts.c#L222
Avatar de l’utilisateur
VogtinatorPremium
Niveau 9: IC (Compteur Infatigable)
Niveau 9: IC (Compteur Infatigable)
Prochain niv.: 1.6%
 
Messages: 217
Inscription: 29 Mar 2014, 15:55
Genre: Homme
Calculatrice(s):
MyCalcs profile

Re: keycodes SDL manquants pour nspire CX-II

Message non lude SlyVTT » 20 Mar 2021, 09:02

Hi,

As a follow up, I developed a Keyboard handler class for my GUI Toolkit.

I am now able to detect and manage keypressed and keyreleased events as well as status of all individual keys except one single key that seems not to work : the ON/HOME :nsho: key.

As per Hachskpire Wiki, it should be addressed by looking at bit 9 of register 900E0010 but it does not seen to work.
All the other keys are ok.

I developed a small routine that scan all the registers from 900E0010 to 900E001F to check where it can be mapped, but I am not able to find any bit representing that key (of course if works for all the other keys). So I do not understand how this key is working.

the Key handler code is here https://github.com/SlyVTT/Widget-for-TI-NSpire/blob/main/Toolkit/KeyboardTask.cpp, and key ON/HOME code is at line 61. I need to optimise the code, but first would like it to work in a dirty mode :p

It is a bit frustrating to have a handler able to manage all the keys (touchpad arrows and click are managed by the "Mouse" handler not in this scope) except one. It is like falling at kilometre 42 in a marathon !!!

If someone has an idea.

Cheers

Sly
Some works in progress :
The GUI Toolkit NF for nSpireMyShmup for fxCG-50Magic Light for Casio Graph 90+E
and
Magic Light for nSpire CX/CX-II
Simple Text Editor for nSpireOutRun for Casio Graph 90+E
95%
50%
100%
75%
100%
And more to come ... stay tuned
Avatar de l’utilisateur
SlyVTTPremium
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Prochain niv.: 43%
 
Messages: 482
Images: 31
Inscription: 19 Jan 2021, 09:41
Localisation: France
Genre: Homme
Calculatrice(s):
MyCalcs profile
GitHub: SlyVTT

Re: keycodes SDL manquants pour nspire CX-II

Message non lude Vogtinator » 21 Mar 2021, 18:48

As per Hachskpire Wiki, it should be addressed by looking at bit 9 of register 900E0010 but it does not seen to work.

On the CX and CX II, the bit in the keypad registers doesn't seem to be set anymore and only the bit from a PMU register works. I added some text to the wiki page for that now.

The fix is to use the on_key_pressed() function from libndls instead, which works on all models.
Avatar de l’utilisateur
VogtinatorPremium
Niveau 9: IC (Compteur Infatigable)
Niveau 9: IC (Compteur Infatigable)
Prochain niv.: 1.6%
 
Messages: 217
Inscription: 29 Mar 2014, 15:55
Genre: Homme
Calculatrice(s):
MyCalcs profile

Re: keycodes SDL manquants pour nspire CX-II

Message non lude SlyVTT » 21 Mar 2021, 18:56

Thanks Vogtinator,
so I am not completely mad ;-) I turned into my code so many times to understand what's was going wrong that I finished to have some doubts ...
Thanks for your feedback.
Sly
Some works in progress :
The GUI Toolkit NF for nSpireMyShmup for fxCG-50Magic Light for Casio Graph 90+E
and
Magic Light for nSpire CX/CX-II
Simple Text Editor for nSpireOutRun for Casio Graph 90+E
95%
50%
100%
75%
100%
And more to come ... stay tuned
Avatar de l’utilisateur
SlyVTTPremium
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Prochain niv.: 43%
 
Messages: 482
Images: 31
Inscription: 19 Jan 2021, 09:41
Localisation: France
Genre: Homme
Calculatrice(s):
MyCalcs profile
GitHub: SlyVTT

Re: keycodes SDL manquants pour nspire CX-II

Message non lude SlyVTT » 22 Mar 2021, 09:11

Hi Vogtinator,

Works fine while using the on_key_pressed() function of libndls but seems that the any_key_pressed() and isKeyPressed() haven't been updated yet. They just seem to scrutinize the bits of the memory address from 0x900E0010 to 0x900E001E.
This means that is we just look if a key is pressed with any_key_pressed() and just press On/HOME, it won't be detected (I tested this and confirm it does not work)
Same if we have a loop with on_key_pressed() branching to key detection, isKeyPressed( NSP_KEY_HOME ) should not return true cause the memory address does not seem to be mapped for that specific key. (I haven't tested it right now, but reading the libndls code, it should not work).

I will push an issue on Ndless git.

FYI, i used the updated information from the "new" memory mapping of ON/HOME key and it works very well now. Thanks for your very good job.

Ciao

Sly
Some works in progress :
The GUI Toolkit NF for nSpireMyShmup for fxCG-50Magic Light for Casio Graph 90+E
and
Magic Light for nSpire CX/CX-II
Simple Text Editor for nSpireOutRun for Casio Graph 90+E
95%
50%
100%
75%
100%
And more to come ... stay tuned
Avatar de l’utilisateur
SlyVTTPremium
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Prochain niv.: 43%
 
Messages: 482
Images: 31
Inscription: 19 Jan 2021, 09:41
Localisation: France
Genre: Homme
Calculatrice(s):
MyCalcs profile
GitHub: SlyVTT


Retourner vers Native: Ndless, Linux, ...

Qui est en ligne

Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 8 invités

-
Rechercher
-
Social TI-Planet
-
Sujets à la une
Comparaisons des meilleurs prix pour acheter sa calculatrice !
Aidez la communauté à documenter les révisions matérielles en listant vos calculatrices graphiques !
Phi NumWorks jailbreak
123
-
Faire un don / Premium
Pour plus de concours, de lots, de tests, nous aider à payer le serveur et les domaines...
Faire un don
Découvrez les avantages d'un compte donateur !
JoinRejoignez the donors and/or premium!les donateurs et/ou premium !


Partenaires et pub
Notre partenaire Jarrety Calculatrices à acheter chez Calcuso
-
Stats.
1073 utilisateurs:
>1058 invités
>10 membres
>5 robots
Record simultané (sur 6 mois):
6892 utilisateurs (le 07/06/2017)
-
Autres sites intéressants
Texas Instruments Education
Global | France
 (English / Français)
Banque de programmes TI
ticalc.org
 (English)
La communauté TI-82
tout82.free.fr
 (Français)