Mozilla::DOM::KeyEvent
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". XXX: This is currently buggy, because you have to call them as methods on the key event object. DEPRECATED: a little premature to deprecate, not having an alternative (aside from using the numbers directly), but I really don't like how they're currently implemented.
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))
See Event::InitEvent for more information. This method is basically the same as InitEvent, but with six (seven normally) extra arguments. (XXX: add docs for args)
Note: I don't see how you can Create or QueryInterface an AbstractView, and trying to pass in 0 or undef was 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.
0
undef
Mozilla::DOM, /usr/include/mozilla/nsIDOMKeyEvent.h, "sections 1.7.4 and Appendix A of the DOM level 3 specification"
Copyright (C) 2005, Scott Lanning
This software is licensed under the LGPL. See Mozilla::DOM for a full notice.
To install Mozilla::DOM, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mozilla::DOM
CPAN shell
perl -MCPAN -e shell install Mozilla::DOM
For more information on module installation, please visit the detailed CPAN module installation guide.