My end goal is to have a handler that will do something if I press a key such as #"1"
I have been reading the R3 View - Event Handling document, and trying to run the code in R3 View, I get no results. This is the handler I have copied:
my-handler: [
name: 'my-handler
priority: 50
handler: func [event] [
print ["event:" event/type event/offset]
if switch event/type [
close [true]
key [event/key = escape]
] [
unhandle-events self
unview event/window
quit
]
show event/window
none
]
]
I have tried both methods to run the event handler, with no results:
handle-events my-handler
view layout [button]
and
view/options layout [button] [handler: my-handler]
I'm at a loss for what to do, could someone point me in the right direction?
Here is my attempt at making a handler for a key:
view/options [button] [
handler: [
name: 'my-handler
priority: 50
handler: func [event] [
if (event/key = #"1") [print "hi"]
]
]
]
As far as I can tell, it doesn't do anything...
This should work with the published saphirion r3-gui, but is very crude.