The manakai project

Web::DOM::KeyboardEvent

The DOM KeyboardEvent object

DESCRIPTION

The Web::DOM::KeyboardEvent class implements the DOM KeyboardEvent interface.

METHODS

In addition to the methods of the Web::DOM::Event and Web::DOM::UIEvent classes, following methods are available:

$boolean = $ev->alt_key
$boolean = $ev->alt_graph_key
$boolean = $ev->ctrl_key
$boolean = $ev->meta_key
$boolean = $ev->shift_key
$boolean = $ev->get_modifier_state ($key_name)

Return whether the modifier key is pressed or not. [DOM3EVENTS] [MANAKAI]

$string = $ev->char
$int = $ev->char_code
$string = $ev->code
$string = $ev->key
$int = $ev->key_code
$int = $ev->which

Return the value representing the key or the input string in several different ways. [DOM3EVENTS] [UIEVENTS]

$string = $ev->locale

Return the keyboard locale. [DOM3EVENTS]

$int = $ev->location

Return the location of the key. [DOM3EVENTS]

$boolean = $ev->repeat

Return whether the key has been pressed or not. [DOM3EVENTS]

In addition, deprecated init_keyboard_event method is supported. [DOM3EVENTS]

The new method of the Web::DOM::KeyboardEvent class accepts the char, key, code, location, ctrl_key, shift_key, alt_key, meta_key, repeat, locale, char_code, key_code, and which name/value pairs in its second arguments, in addition to the name/value pairs for Web::DOM::Event and Web::DOM::UIEvent objects in general. [DOM3EVENTS] [UIEVENTS]

CONSTANTS

Constants are exported from the Web::DOM::KeyboardEvent module by default. Following constants are used by the location method [DOM3EVENTS]:

  DOM_KEY_LOCATION_STANDARD DOM_KEY_LOCATION_LEFT
  DOM_KEY_LOCATION_RIGHT DOM_KEY_LOCATION_NUMPAD
  DOM_KEY_LOCATION_MOBILE DOM_KEY_LOCATION_JOYSTICK

SPECIFICATIONS

DOM3EVENTS

DOM Level 3 Events <http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-uievents>.

UIEVENTS

UI Events <https://dvcs.w3.org/hg/d4e/raw-file/tip/source_respec.htm#constructor-uievent>.

MANAKAI

manakai DOM Extensions <http://suika.suikawiki.org/~wakaba/wiki/sw/n/manakai++DOM%20Extensions>.

SEE ALSO

Web::DOM::Event, Web::DOM::UIEvent, Web::DOM::CompositionEvent.

AUTHOR

Wakaba <wakaba@suikawiki.org>.

LICENSE

Copyright 2013 Wakaba <wakaba@suikawiki.org>.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.