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 ...).
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
keycodes SDL manquants pour nspire CX-II
Voir le premier message non lu • 6 messages
• Page 1 sur 1
keycodes SDL manquants pour nspire CX-II
Some works in progress :
The GUI Toolkit NF for nSpire | MyShmup for fxCG-50 | Magic Light for Casio Graph 90+E and Magic Light for nSpire CX/CX-II | Simple Text Editor for nSpire | OutRun for Casio Graph 90+E |
And more to come ... stay tuned
-
SlyVTTPremium
Niveau 12: CP (Calculatrice sur Pattes)- Messages: 482
- Images: 31
- Inscription: 19 Jan 2021, 09:41
- Localisation: France
- Genre:
- Calculatrice(s):→ MyCalcs profile
- GitHub: SlyVTT
Re: keycodes SDL manquants pour nspire CX-II
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
https://github.com/Vogtinator/nSDL/blob ... nts.c#L222
-
VogtinatorPremium
Niveau 9: IC (Compteur Infatigable)- Messages: 217
- Inscription: 29 Mar 2014, 15:55
- Genre:
- Calculatrice(s):→ MyCalcs profile
Re: keycodes SDL manquants pour nspire CX-II
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 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
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
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 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
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 nSpire | MyShmup for fxCG-50 | Magic Light for Casio Graph 90+E and Magic Light for nSpire CX/CX-II | Simple Text Editor for nSpire | OutRun for Casio Graph 90+E |
And more to come ... stay tuned
-
SlyVTTPremium
Niveau 12: CP (Calculatrice sur Pattes)- Messages: 482
- Images: 31
- Inscription: 19 Jan 2021, 09:41
- Localisation: France
- Genre:
- Calculatrice(s):→ MyCalcs profile
- GitHub: SlyVTT
Re: keycodes SDL manquants pour nspire CX-II
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.
-
VogtinatorPremium
Niveau 9: IC (Compteur Infatigable)- Messages: 217
- Inscription: 29 Mar 2014, 15:55
- Genre:
- Calculatrice(s):→ MyCalcs profile
Re: keycodes SDL manquants pour nspire CX-II
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
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 nSpire | MyShmup for fxCG-50 | Magic Light for Casio Graph 90+E and Magic Light for nSpire CX/CX-II | Simple Text Editor for nSpire | OutRun for Casio Graph 90+E |
And more to come ... stay tuned
-
SlyVTTPremium
Niveau 12: CP (Calculatrice sur Pattes)- Messages: 482
- Images: 31
- Inscription: 19 Jan 2021, 09:41
- Localisation: France
- Genre:
- Calculatrice(s):→ MyCalcs profile
- GitHub: SlyVTT
Re: keycodes SDL manquants pour nspire CX-II
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
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 nSpire | MyShmup for fxCG-50 | Magic Light for Casio Graph 90+E and Magic Light for nSpire CX/CX-II | Simple Text Editor for nSpire | OutRun for Casio Graph 90+E |
And more to come ... stay tuned
-
SlyVTTPremium
Niveau 12: CP (Calculatrice sur Pattes)- Messages: 482
- Images: 31
- Inscription: 19 Jan 2021, 09:41
- Localisation: France
- Genre:
- Calculatrice(s):→ MyCalcs profile
- GitHub: SlyVTT
6 messages
• Page 1 sur 1
Retourner vers Native: Ndless, Linux, ...
Qui est en ligne
Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 8 invités