generating function keys

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

generating function keys

Peter Uhnak
Hi,

how can one generate function keys? (F1 to F12)

I've made a morph for testing

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c := Morph subclass: #MyKeyMorph.

c compile: 'handlesKeyboard: evt
        ^ true'.

c compile: 'handleKeystroke: evt
        self logCr: evt'.

c compile: 'handleKeyUp: evt
        self logCr: evt'.

c compile: 'handleKeyDown: evt
        self logCr: evt'.

m := c new.
m openInWindow.
m takeKeyboardFocus
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

However the functions keys are not being generated.

Is this something that would have to be done in the VM?
I'm using linux btw, but ideally it should work on all platforms.

Thanks,
Peter

Reply | Threaded
Open this post in threaded view
|

Re: generating function keys

Nicolai Hess-3-2


2016-08-08 19:39 GMT+02:00 Peter Uhnak <[hidden email]>:
Hi,

how can one generate function keys? (F1 to F12)

I've made a morph for testing

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c := Morph subclass: #MyKeyMorph.

c compile: 'handlesKeyboard: evt
        ^ true'.

c compile: 'handleKeystroke: evt
        self logCr: evt'.

c compile: 'handleKeyUp: evt
        self logCr: evt'.

c compile: 'handleKeyDown: evt
        self logCr: evt'.

m := c new.
m openInWindow.
m takeKeyboardFocus
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

However the functions keys are not being generated.

Is this something that would have to be done in the VM?

Yes, function do not generate any events on the pharo linux vm (for Windows, at least keydown/keyup events, bot no keystroke events).
 
I'm using linux btw, but ideally it should work on all platforms.

Thanks,
Peter