HP Forums

Full Version: Custom App handling of events
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Tim,

Thanks for the clarification on variables, but since you're on, I thought I'd ask something else that's been confusing to me.

A built-in App like Function responds to soft-menus AND other events (key presses, mouse etc.)

If I write an App that puts up a custom menu bar I need to poll for events within a loop in order to process the soft-menus. There doesn't seem to be an API to pass events I'm not interested in to the system for processing. So if I'm handling my soft-menus, other keys (e.g. View) are basically dead.

I don't want to reproduce the functionality of every key in my App. Is there a way to handle this? Otherwise, I don't see an easy way to create useful soft-menus at the moment.
I think there is no multithreading or events besides the key functions for custom keys. So you need to build a simple state machine where you check the mouse (or menu?, if available) position and react to that.
Eried,

I've already done that. But the problem is that there is no mechanism to respond to "system" events (i.e. ones that I am not explicitly handling).

If you look at the built-in apps they can clearly do this.
I understand that in this code the programming capabilities are very *sandboxed*, but can you provide an example code?
Eried,

I'm sorry but I'm not ready to release code yet. I don't see how this would help anyway.
Eried,

If you're interested, I did post an example in the Programs section of the forum:

http://www.hpmuseum.org/forum/thread-308.html

The app works more or less the way I want but it's fairly force-fit into the HP Prime App formalism. The notion of Symbolic/Num/Plot views isn't terrible general IMHO. I did end up writing an event loop to process key presses and mouse events. As you can see, any key events that occur while my custom menus are on screen have to be processed from within the app -- there's no way to get the system to do it currently.

-- jeff
Reference URL's