The second argument of GtkMozEmbed's dom_key_* signal handlers will be a Mozilla::DOM::KeyEvent object, which is a wrapper around an instance of Mozilla's nsIDOMKeyEvent interface. This inherits from UIEvent.
Note: although <DOMImplementation|Mozilla::DOM::DOMImplementation>'s HasFeature('KeyEvents', '2.0') (and '3.0' and '') claimed (on my system) that KeyEvents were not supported, I found that you can in fact do key events.
The following constants are available to be compared with GetKeyCode.
You can access these either through the (mouse or key) event object,
export them all with
use Mozilla::DOM::KeyEvent qw(:keycodes),
or export them individually.
Pass this to QueryInterface.
This function returns true if the Alt key was held down when the key event occured. (Note: I found this to not be strictly true.)
This function gets the character code, which is the Unicode number representing that character (e.g. 'a' is 97). For example, you could pass this number to the `chr' function in Perl.
This function returns true if the Ctrl key was held down when the key event occured.
This function gets the key code for "special" keys, such as the function keys (e.g., F3), caps lock, right arrow, etc.
This function returns true if the Meta key was held down when the key event occured.
This function returns true if the Shift key was held down when the key event occured.
- $eventtype (string)
- $canbubble (boolean)
- $cancelable (boolean)
- $ctrlkey (boolean)
- $altkey (boolean)
- $shiftkey (boolean)
- $metakey (boolean)
- $keycode (integer (long))
- $charcode (integer (long))
Note: I don't see how you can Create or QueryInterface an AbstractView, and trying to pass in
undefwas just causing a segfault, so I've omitted what would normally be the 4th argument of this method. If someone can explain why you'd need it and how you'd use it, then I can put it back in.
Mozilla::DOM, sections 1.7.4 and Appendix A of the DOM level 3 specification
Copyright (C) 2005-2007, Scott Lanning
This software is licensed under the LGPL. See Mozilla::DOM for a full notice.