Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
The other thing I need to pick a bone with you about is the ctrl/shift/caps system. I found it positively baffling when I tried to use LuaZM, and I may make changes to try to make the system more intuitive. I'm also considering making gets() and friends show a cursor, a cursor that changes to an A, a, 1, etc as the mode changes. I'd strongly recommend that you add something like that in case I don't get to it quickly.
I thought of a cursor too, I might look at this. It could change color according to whether you're in shift, alpha or caps mode.
juju2143 wrote:
I thought of a cursor too, I might look at this. It could change color according to whether you're in shift, alpha or caps mode.
Also, can you make the [MODE] key work properly to leave the add-in in such a way that when you press it again, you return to text entry? If you need help with doing that, I would be happy to toss the proper canned code in your direction.
KermMartian wrote:
juju2143 wrote:
I thought of a cursor too, I might look at this. It could change color according to whether you're in shift, alpha or caps mode.
Also, can you make the [MODE] key work properly to leave the add-in in such a way that when you press it again, you return to text entry? If you need help with doing that, I would be happy to toss the proper canned code in your direction.
I would like to know how to do that. You could put the code on the wiki?
juju2143 wrote:
KermMartian wrote:
juju2143 wrote:
I thought of a cursor too, I might look at this. It could change color according to whether you're in shift, alpha or caps mode.
Also, can you make the [MODE] key work properly to leave the add-in in such a way that when you press it again, you return to text entry? If you need help with doing that, I would be happy to toss the proper canned code in your direction.
I would like to know how to do that. You could put the code on the wiki?


To add code in a wiki, alll you do is put a space before each line you want in <pre> format. Wink
Shock Were you tired when you wrote that post, or do you really not realize what a spam/offtopic/useless post it is? He asked for specific code and you told him how Mediawiki works.

Juju: Tetrizm does it this way. The latter two lines are the key ones.

Code:
if ((key = PRGM_GetKey())) {
    int r,c,k;
    GetKeyWait_OS(&r,&c,2,1,0,&k);
    Bdisp_EnableColor(1);
}
This post unfortunately is the second draft of itself, the first having disappeared in an unfortunate key-fumbling incident. So, I'm loving PrizmIO, and there's a few features I want/need to make it even more awesome, particularly for use in LuaZM. To whit:

:: Use of an OS key syscall like PRGM_GetKey() to allow for proper screenshotting. See preceding post.
:: Use of an OS syscall sequence as above to allow for proper use of the [MENU] key in programs.
:: Fix the way modifiers work. If I were writing it, I would have four modes: normal, shift, alpha, and uppercase-alpha (ie, shift-alpha). Get rid of caps and ctrl; they're confusing. Start off in normal mode, not caps (?) mode. Turn off all modifiers after one key press. The character set seems good, but I reserve the right to suggest additions. Smile I think there are a few unused keys, like normal-ln, normal-sin, etc. Actually, you'd also need an uppercase/lowercase mode. I recommend you do it TI-83+-style.
:: Something is really wrong with tab. Even after you backspace a tab, the resulting string is incorrect.
:: A cursor. At least an underline at the current position in the foreground color. An underlined 'a' for alpha, an underlined up-arrow symbol for shift, an 'A' for shift-alpha, and an inverted underlined 'A' or 'a' for uppercase or lowercase alpha-lock mode.
:: Lower-priority: history.
KermMartian wrote:

:: Use of an OS key syscall like PRGM_GetKey() to allow for proper screenshotting. See preceding post.
:: Use of an OS syscall sequence as above to allow for proper use of the [MENU] key in programs.
Good idea.
KermMartian wrote:

:: Fix the way modifiers work. If I were writing it, I would have four modes: normal, shift, alpha, and uppercase-alpha (ie, shift-alpha). Get rid of caps and ctrl; they're confusing. Start off in normal mode, not caps (?) mode. Turn off all modifiers after one key press. The character set seems good, but I reserve the right to suggest additions. Smile I think there are a few unused keys, like normal-ln, normal-sin, etc. Actually, you'd also need an uppercase/lowercase mode. I recommend you do it TI-83+-style.
The keyboard layout is still in a beta state, any improvements are welcome. Also, currently, the keyboard functions only return chars, making it return a string instead might be a good idea anyway if I want to handle the F-keys UNIX-style too. I might just rewrite the whole stuff, some functions names are misleading. Also, I should make a non-blocking getchar.
KermMartian wrote:

:: Something is really wrong with tab. Even after you backspace a tab, the resulting string is incorrect.
Sounds like a bug.
KermMartian wrote:

:: A cursor. At least an underline at the current position in the foreground color. An underlined 'a' for alpha, an underlined up-arrow symbol for shift, an 'A' for shift-alpha, and an inverted underlined 'A' or 'a' for uppercase or lowercase alpha-lock mode.
That's what I was working on this morning.
KermMartian wrote:

:: Lower-priority: history.
For that, you might want to port libreadline. EDIT: For that I should implement the arrow keys, which needs a getchar that returns a string or something.

I think it'll keep me occupied for a while. Smile
KermMartian wrote:
Shock Were you tired when you wrote that post, or do you really not realize what a spam/offtopic/useless post it is? He asked for specific code and you told him how Mediawiki works.


I am sorry I misunderstood him. Yes, I was tired. :-/
juju2143 wrote:

KermMartian wrote:

:: Fix the way modifiers work. If I were writing it, I would have four modes: normal, shift, alpha, and uppercase-alpha (ie, shift-alpha). Get rid of caps and ctrl; they're confusing. Start off in normal mode, not caps (?) mode. Turn off all modifiers after one key press. The character set seems good, but I reserve the right to suggest additions. Smile I think there are a few unused keys, like normal-ln, normal-sin, etc. Actually, you'd also need an uppercase/lowercase mode. I recommend you do it TI-83+-style.
The keyboard layout is still in a beta state, any improvements are welcome. Also, currently, the keyboard functions only return chars, making it return a string instead might be a good idea anyway if I want to handle the F-keys UNIX-style too. I might just rewrite the whole stuff, some functions names are misleading. Also, I should make a non-blocking getchar.
KermMartian wrote:

:: A cursor. At least an underline at the current position in the foreground color. An underlined 'a' for alpha, an underlined up-arrow symbol for shift, an 'A' for shift-alpha, and an inverted underlined 'A' or 'a' for uppercase or lowercase alpha-lock mode.
That's what I was working on this morning.
KermMartian wrote:

:: Lower-priority: history.
For that, you might want to port libreadline. EDIT: For that I should implement the arrow keys, which needs a getchar that returns a string or something.

I think it'll keep me occupied for a while. Smile


IMO there should be two functions, a blockingish one that will return the fancy chars, and one that is mainly just an expanded Getkey_* function that returns the raw keycodes for use with arrow's and such but also allows for the custom mapping used by the current setup. Basically like getcsc vs Getkey on the TI calc's. That way there can be consistency for the custom mapping and arrow keys while still allowing for the more advanced input buffering.
TheStorm wrote:
juju2143 wrote:

KermMartian wrote:

:: Fix the way modifiers work. If I were writing it, I would have four modes: normal, shift, alpha, and uppercase-alpha (ie, shift-alpha). Get rid of caps and ctrl; they're confusing. Start off in normal mode, not caps (?) mode. Turn off all modifiers after one key press. The character set seems good, but I reserve the right to suggest additions. Smile I think there are a few unused keys, like normal-ln, normal-sin, etc. Actually, you'd also need an uppercase/lowercase mode. I recommend you do it TI-83+-style.
The keyboard layout is still in a beta state, any improvements are welcome. Also, currently, the keyboard functions only return chars, making it return a string instead might be a good idea anyway if I want to handle the F-keys UNIX-style too. I might just rewrite the whole stuff, some functions names are misleading. Also, I should make a non-blocking getchar.
KermMartian wrote:

:: A cursor. At least an underline at the current position in the foreground color. An underlined 'a' for alpha, an underlined up-arrow symbol for shift, an 'A' for shift-alpha, and an inverted underlined 'A' or 'a' for uppercase or lowercase alpha-lock mode.
That's what I was working on this morning.
KermMartian wrote:

:: Lower-priority: history.
For that, you might want to port libreadline. EDIT: For that I should implement the arrow keys, which needs a getchar that returns a string or something.

I think it'll keep me occupied for a while. Smile


IMO there should be two functions, a blockingish one that will return the fancy chars, and one that is mainly just an expanded Getkey_* function that returns the raw keycodes for use with arrow's and such but also allows for the custom mapping used by the current setup. Basically like getcsc vs Getkey on the TI calc's. That way there can be consistency for the custom mapping and arrow keys while still allowing for the more advanced input buffering.

That's a good idea. Actually right now you can check if a certain key is pressed or not, but a getch function that return PRGM_GetKey codes instead would be a good idea.

Also I'm out of town for the weekend and I forgot my cable to upload stuff on my Prizm and my bro dragged me outside all the time for the last 3 days so I've had no time whatsoever to program anything, so sorry for the lack of updates this week. And remember, if you want to help me, feel free to fork my project on GitHub, make the change and if I like I'll merge the change into my branch.
Hope you enjoy your weekend, and I look forward to your progress when you return. I'm feeling unwell this weekend, so I'm afraid I'm not going to be able to make a branch and add new features just yet.
for the up/down/left/right and other special keys -> why not use a word for that and a byte for normal stuff? if getch or w/e returns a short or int that can be possible.

<edit>

What about m68k keyboard style? That way was much better to me than the z80 calc method as it was much faster ad easier to use.
Will the next version of PrizmIO be incompatible with the current version, or if I start on a project of mine using it now will upgrading PrizmIO later keep compatibility?
Ashbad wrote:
Will the next version of PrizmIO be incompatible with the current version, or if I start on a project of mine using it now will upgrading PrizmIO later keep compatibility?
As far as I understand, the changes are mostly going to be internal, including the cursors, the improved keymappings, and possible history storage, and the API won't change much if at all. I'd say that even if it does change, it won't be drastic, so you're likely safe in not wasting much time if you use the current version.
PrizmIO updated to upstream (I think), so new cursors (if they work), new functions names (you can keep compatibility with a #define) and stdio replacement. Tonight: improved keymapping and serial port stdio replacement. Have fun.
juju2143 wrote:
PrizmIO updated to upstream (I think), so new cursors (if they work), new functions names (you can keep compatibility with a #define) and stdio replacement. Tonight: improved keymapping and serial port stdio replacement. Have fun.
Great, sounds awesome. I need functions that let me write or read a specific number of characters to/from the terminal, rather than until an end-of-string or [ENTER]; does PrizmIO have that yet? Or should I just build them myself out of your putc/getch routines?
IIRC there's a number of characters parameter, but it doesn't work yet. Might check this out as well. For now, you can just wrap around getch.
juju2143 wrote:
IIRC there's a number of characters parameter, but it doesn't work yet. Might check this out as well. For now, you can just wrap around getch.
OK, that is reasonable. Did you get a chance to try out the cursor stuff yet to see if it works?
UPDATE

PrizmIO merged with its Nspire counterpart! All new commits are now at this URL: http://nspforge.unsads.com/p/nspireio

Also rewrote the keyboard part, might or might not work yet.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 2 of 3
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement