Hi,
Modifiers alone do not per se generate a key event in vcl for years but
a specialized "KeyModChange" (modifier changed) event. This is not bound
to the awt implementation, so I guess it is not available to any awt
customer. Moreover key mod change is not dispatched on every modifier
change, but only on key releases.
This peculiar behaviour has its origin in the rather unique feature that
lead to the implementation of KeyModChange, namely the explicit
distinction that the left or right shift key was pressed and then
released. This action switches the writing direction.
The fact that you get a key input for Alt is a side effect due to the
duplicate role of Alt as KEY_MENU which is native on Windows and
emulated on other platforms.
So currently you don't get key events for modifiers, only for modified
keys. Only on Windows you get a key event for Alt pressed as actually a
side effect.
Kind regards, pl
Mathias Bauer wrote:
Andrew Douglas Pitonyak wrote:
I was asked about a simple key handler in Calc. With the key handler, if
you pressed the alt key, the event handler was called. Unfortunately, if
you pressed the Ctrl key the event handler was not called.
Pressing a combination with the Ctrl key worked as expected, and the
Ctrl key was properly indicated in the attributes.
Given that the com.sun.star.awt.XKeyHandler caused the handler to be
called when I pressed the Alt key, I also expected it to be called when
I pressed the Ctrl key.
Sounds reasonable. The KeyHandler notifications are built upon internal
notifications from VCL. So if no KeyHandler is called I assume that also
VCL does not send this key event to the application code.
I've sent a CC: to the gsl list as I hope that the gsl developers can
shed some light on this. Please use "Reply All" for responding.
Ciao,
Mathias
--
If you give someone a program, you will frustrate them for a day;
if you teach them how to program, you will frustrate them for a lifetime.
-- Author unknown
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]