-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TI-nspire CX CAS: Keypad Input/Mapping Enhancements #347
Comments
I think it would be better to have a single issue for keypad input enhancements. |
Sure. I'll point the others to this issue and I'll change the opening post accordingly. |
Just realized that the ^-keyb on a physical computer keyboard does not map to ^ at the virtual handheld keyboard. Maybe this could be enhanced together with the above. |
After reading the source in qtkeypadbridge.cpp I found out that many keymappings are not accessible for me, at least not with german keyboard layout on linux (other systems not tested). Additionally the window manager seems to grab the [ALT]-Key so that some of these key combinations trigger different actions related to the window manager instead of doing what qtkeypadbridge.cpp suggests. |
I cannot confirm the [ALT]-Key problem, because I configured my window manager to use the "Windows-Key" instead. But fun fact on the |
This happens because the calculator sees Shift + /, which produces \. Maybe for non-alpha keys the modifiers should be ignored. |
How does the calculator gets notified about the modifier? As far as I understand the keybinding, Qt-Keys are mapped to Keypad-"Actions". Are Qt-Modifiers queried somewhere else, too? |
It's just normal keys, pressing and releasing the shift key on the keyboard presses and releases the shift key on the calculator. |
Makes sense. I'm currently experimenting with the code: sending a release of the shift key before any div operation does not work - or at least my approach isn't suitable if (translated != QtKeyMap.end())
{
// here <----
if (*translated == keymap::div)
{
// force release of shift key on any division
setKeypad(keymap::shift, false);
}
// to here <---
pressed_keys.insert(vkey, *translated);
setKeypad(*translated, true);
} I also tried auto mkey = event->key();
// here <----
if (event->modifiers() & Qt::ShiftModifier && mkey == Qt::Key_Slash) {
setKeypad(keymap::shift, false);
}
// to here <---
if (event->modifiers() & Qt::ShiftModifier && mkey == Qt::Key_Alt)
{
setKeypad(keymap::shift, false);
return;
} Only workaround that helps me: Disabling the keybinding for shift altogether. |
I guess that happens for two reasons:
|
Indeed. Hence I'd recommend to not use the keyboard's [Shift] directly as Calculator's [Shift] but with some variation like [Alt]+[Shift] on the keyboard. I'll provide a fork to review and eventually pull. (I'm aware of this having lots of implications)
Yeah, that's what I've assumed afterwards. |
Not directly, because of the async nature of the keypad again. You'd have to send Ctrl first (or make sure it's pressed already), then set ( as pressed. For press events that's somewhat doable with a queue that just waits a ~50ms or so, but coordinating the release events gets complex. |
I'm working on an input queue implementation (I've got a working prototype atm). Would you welcome such a contribution, @Vogtinator ? |
Global variables don't really hurt because the keypad state itself is a global variable anyway... |
Yes it is, but anway here's what I've got so far, up for discussion: https://github.com/cgloeckner/firebird-input-queue Some notes:
I've tried to mimic your coding style (regarding naming convention and placement of |
Hi,
there are multiple keypad input enhancements, some important, others optional. Sorted from by importance (most important at the top, imho):
Division Operator
Typing
/
(using number keys) places\
. So no division can be entered using the/
on the numbers above the keyboard's letters; using the numpad equivalent works fine.Del Key
The
del
key behaves just likebackspace
: it deletes the character to the left (but is assumed to delete the character to the right of the cursor).Caps Lock
In CX CAS pressing
ctrl
followed byshift
enteres theCAPS
mode. Is there a way to use the native keyboard's caps lock key to control this behavior?Home/End Mapping
Home
maps to theon
-Key andEnd
to the Scratchpad, which is tricky: When selecting a part of a calculator line, the user may useHome
andEnd
to navigate the current line. Maybe the context menu key could be used here, but it'd make things even less intuitive... Maybe thePause
key could be used foron
?... I don't have a good suggestion here, yet.Btw I like the binding of
PageUp
/PageDown
fordoc
andmenu
❤️Assignment Operator
I'm used to type function declarations using
:=
by entering:
followed by=
(instead of using the TI's definition feature via ctrl), since the TI Teachers Software for the CX CAS supported this. The Firebird Emulator ignores the:
altogether.Factorial and Percentage Operator
I'm used to type in
!
and%
directly, based on my experience with the TI Teacher Software for CX CAS.Entering
!
using my computer keyboard does not lead to factorial, neither leads%
to automatic percentage conversion.Lesser/Greater Operator
Typing
<
or>
does not work as expected. According to the keybinding,<
createsE
and>
does not work (the flag symbol does nothing).Tested with:
firebird-emu
v1.6glocke
The text was updated successfully, but these errors were encountered: