Alternatively, join us on Discord.

83/84 hooks - requests / ideas

Started by E37, April 26, 2017, 01:11:03 am

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

E37

I have become pretty adept at creating and managing hooks. For those who don't know what a hook is, it allows the programmer to modify the OS's behavior on certain events such as modifying or cancelling key presses, creating custom menus, among other things. If you haven't tried zStart yet, you really should. I won't give an advertisement for something I didn't make, but it does do some really cool things almost all of which are hooks.

So let me explain why I created this post. My calc's trace key is broken. I can press it but it won't register any key press. I would like the function of that key back - without getting a new calc. So, I make a key hook. It allows me to press ON and GRAPH at the same time and the calc to think that the trace key is being pressed. Awesome right? But what about 2nd - trace? I can make it so that when I go to to the catalog and select ZoomRcl it instead presses 2nd - trace. I can go on swapping keys all day long... But, what if I want to do something else? Say, when I press ON+X it runs a program, changes a setting or opens a custom menu. That is some of the power of hooks.

I would be happy to teach anyone who knows the basics of assembly how to use hooks or to write a custom one for someone since I don't have a project to work on right now. Any suggestions on what to create?
I've never finished a project, there is always a way to improve!
What's my calc's name? Convert $37 to decimal. Look up that element in the periodic table. Then take the abbreviation of that element and you have it!
Look! A slime!    <(^.^)>

WholeWheatBagels

A forced reset / wipe might be useful if theres a bunch of random variables that need to be cleaned up or if you're too lazy to find GarbageCollect
[On] + [2nd] + [Clear]
Living in another world to you.



Also in case you were wondering Frankie did go to Hollywood

E37

Quote from: WholeWheatBagels on April 26, 2017, 01:32:02 am
A forced reset / wipe might be useful if theres a bunch of random variables that need to be cleaned up or if you're too lazy to find GarbageCollect
[On] + [2nd] + [Clear]

What do you mean by a forced reset? A ram clear? If that is all you want, install zStart, and to to the reset ram option in the memory menu and press ON+(any number 1-9) twice. Then whenever you press ON + thatKey your calc will reset ram.
I've never finished a project, there is always a way to improve!
What's my calc's name? Convert $37 to decimal. Look up that element in the periodic table. Then take the abbreviation of that element and you have it!
Look! A slime!    <(^.^)>

DJ Omnimaga

April 26, 2017, 07:04:57 pm #3 Last Edit: April 27, 2017, 12:24:52 am by p2
For a key hook, make sure that the calc won't mess up while a Basic program is running (eg with OS vs interrupt vs hook conflicts)

Edit by p2: I hate this "Sent from my Nexus 5 using Tapatalk" >.<


E37

Quote from: DJ Omnimaga on April 26, 2017, 07:04:57 pm
For a key hook, make sure that the calc won't mess up while a Basic program is running (eg with OS vs interrupt vs hook conflicts)


Huh. I didn't think about that. The most useful (in my opinion) allows soft keys (uses 2nd and alpha) which shouldn't be a problem for the basic getkey. I also require the ON key to be held so that the key can still be used. I did notice that the OS seems to disable keyhooks when an asm program is running. I wonder if it is the same for basic?
I've never finished a project, there is always a way to improve!
What's my calc's name? Convert $37 to decimal. Look up that element in the periodic table. Then take the abbreviation of that element and you have it!
Look! A slime!    <(^.^)>

DJ Omnimaga

Aren't there already soft keys in OS 2.53MP or higher?

E37

Quote from: DJ Omnimaga on April 26, 2017, 10:06:44 pm
Aren't there already soft keys in OS 2.53MP or higher?

Soft keys for 2.53? I use 2.43 so I don't know. I am talking about the basic getkey, not the input or prompt function. Wikiti says that the soft key hook is only active in the system monitor so it follows that it wouldn't affect programs. I just tested it and basic programs are unaffected by any key hooks. They are affected by parser hooks of course, but it appears that it the only one. Assembly programs are completely unaffected by hooks.
I've never finished a project, there is always a way to improve!
What's my calc's name? Convert $37 to decimal. Look up that element in the periodic table. Then take the abbreviation of that element and you have it!
Look! A slime!    <(^.^)>

DJ Omnimaga

Yeah they added soft keys in MP OSes. I don't remember how to use them, but if I remember, you have to hold down ALPHA. And yeah I am aware that you are talking about the Basic getkey.

c4ooo

Quote from: DJ Omnimaga on April 26, 2017, 10:06:44 pm
Aren't there already soft keys in OS 2.53MP or higher?

What are soft keys?

E37

Quote from: c4ooo on April 28, 2017, 02:32:50 am
Quote from: DJ Omnimaga on April 26, 2017, 10:06:44 pm
Aren't there already soft keys in OS 2.53MP or higher?

What are soft keys?

Soft keys are affected by second and alpha.
For example: U is a valid keypress and is different from 5 and L5 and u all of which are the same with a normal getkey.
I've never finished a project, there is always a way to improve!
What's my calc's name? Convert $37 to decimal. Look up that element in the periodic table. Then take the abbreviation of that element and you have it!
Look! A slime!    <(^.^)>

Powered by EzPortal