(01-04-2022 02:23 AM)mushman Wrote: Here's a patched version with some changes:
- Textbox follows selected color theme as well as light/dark theme.
- Removed box with layout info and moved shift/alpha icons to the right (more screen is visible).
- Toggle keyboard with [On] button instead of Alpha+Dot.
Cheers!
Thanks for the update!
I'm relatively new here, so please forgive me if this isn't where this should go.
I'm getting an error on line 205. Did you mean to use the "time" system variable, or the "ticks" function?
I also noticed a few things that could use improvement (IMO, others' preferences may vary):
- Perhaps draw icons on the title bar like the Prime does when you press the appropriate button?
- Detect whether the current font size rather than making everything large enough to handle the largest font. (See Easy Sto II code for an example of this that works pretty well. It took some time to get it running reliably, so I wouldn't recommend writing it from scratch unless you know of a better way to do it.)
- Use the "Shift" key to move to capital letters instead of "Alpha" (How the Prime does it natively)
- Perhaps add a "Backspace" and/or "Enter" button on the keyboard?
- If the user holds down either the "Shift" or "Alpha" keys, exit the mode when they're released and don't exit the mode while it's "Del" key with the "Shift" key down, which should delete the next character and leave the Shift mode on.
- Perhaps add an option for it to remember the last mode it was in between calls?
- Add pass-through support for the Apps, Home, Cas, Symb, Plot, Num, Help, View, and Menu buttons. Most built-in features exit whatever mode they're in and execute those buttons directly when they're pressed.
- Take the lower commands on the screen on entry and redraw them above the keyboard when running it. This would only apply to the Home and CAS views, I think.
- Move to Python for much faster drawing routines? It can be done here since it looks like they aren't trying to interact with the command line directly or read screen pixels from within the input loop. The Python methods for reading key states is quite efficient, but would require a poll loop rather than reading the key buffer. It would introduce a roughly fixed 15-20 ms latency on entry, but would get the execution loop to run significantly faster if my testing is any indication.
- Change the exit routine to leave when the "On" key is released rather than when it's pressed, as it currently exits, the calculator sees that "On" is pressed, and immediately runs it again.
I can take a look at making those changes if any of them sound good to other people. Most of them are really simple to do from what I've seen of the code. Just let me know the numbers that sound worthwhile? I'd prefer to avoid making unwanted changes if I can avoid it.
** EDIT: I just checked a few things out, and it looks like the touchscreen reliably registers taps that are just outside the screen area. If people think it's a reasonable thing to do, it should be feasible to leave the current layout as-is, and just add the backspace button to one of the half-keys on the right edge of the keyboard.