- sendkey: enabling new possibilities in AMS BASIC
- 27 Apr 2025 04:32:19 pm
- Last edited by twisted_nematic57 on 24 May 2025 09:12:09 pm; edited 1 time in total
I've recently published a new program, sendkey, that partially solves another fundamental problem with TI-68k BASIC: it enables you to send arbitrary keypresses to the operating system during execution of a BASIC program.
What this means is that now you can programmatically interact with many parts of the OS' GUI. A good example of this is a keyboard program that automatically sends a series of keypresses (effectively a macro), making a certain repetitive action much easier.
This is neat and would be very useful in applications where you need to nudge the OS to do something via a few automated keypresses. However, sendkey is not perfect: you cannot send keypresses to the OS when a dialog, menu, or the PrgmIO screen is active. That is its one critical flaw, and I do not know how to fix it. If you think you know how, you are free to try.
Edit: the below paragraph is outdated; see the reply below this by @Nyall.
Also, I want to be completely honest: there was a technicality that led to a minor legal gray area regarding modification rights in one of the programs that sendkey is based on. The gist is that Samuel Stearley's 'moveleft' program is licensed as freeware, restricting me (in theory) from modifying it and distributing the modified version. However, the technically modified version of moveleft essentially does most of the heavylifting of sendkey. So, I took a look at the source code for moveleft and I determined that it's so simple, so functionally perfect, that it is uncopyrightable. I determined this because moveleft is essentially a barebones sequence of instructions that only follows standard uncreative procedure for sending a keypress event from assembly and nothing more - besides, my "modification" was just to change two bytes of moveleft into whatever keycode that sendkey is supposed to send on the fly. I don't think this should get me into trouble, and you can read more about this here.
What this means is that now you can programmatically interact with many parts of the OS' GUI. A good example of this is a keyboard program that automatically sends a series of keypresses (effectively a macro), making a certain repetitive action much easier.
This is neat and would be very useful in applications where you need to nudge the OS to do something via a few automated keypresses. However, sendkey is not perfect: you cannot send keypresses to the OS when a dialog, menu, or the PrgmIO screen is active. That is its one critical flaw, and I do not know how to fix it. If you think you know how, you are free to try.
Edit: the below paragraph is outdated; see the reply below this by @Nyall.
Also, I want to be completely honest: there was a technicality that led to a minor legal gray area regarding modification rights in one of the programs that sendkey is based on. The gist is that Samuel Stearley's 'moveleft' program is licensed as freeware, restricting me (in theory) from modifying it and distributing the modified version. However, the technically modified version of moveleft essentially does most of the heavylifting of sendkey. So, I took a look at the source code for moveleft and I determined that it's so simple, so functionally perfect, that it is uncopyrightable. I determined this because moveleft is essentially a barebones sequence of instructions that only follows standard uncreative procedure for sending a keypress event from assembly and nothing more - besides, my "modification" was just to change two bytes of moveleft into whatever keycode that sendkey is supposed to send on the fly. I don't think this should get me into trouble, and you can read more about this here.