Key

The key element defines a keyboard shortcut. Event handlers can be used to respond when the appropriate keys are pressed. A key element must be placed inside a keyset element.

More information about key

key 要素はキーボードショートカットを定義する。該当するキーが押されたときへの反応にはイベントハンドラを利用することができる。 key 要素は keyset 要素内に置かなければならない。

key の追加情報


属性:

XUL Element から継承:

align
allowevents
allownegativeassertions
class
coalesceduplicatearcs
collapsed
container
containment
context
contextmenu
datasources
debug
dir
empty
equalsize
flags
flex
height
hidden
id
insertafter
insertbefore
left
maxheight
maxwidth
menu
minheight
minwidth
mousethrough
observes
ordinal
orient
pack
persist
popup
position
ref
removeelement
sortDirection
sortResource
sortResource2
statustext
style
template
tooltip
tooltiptext
top
uri
wait-cursor
width

command

Type: element id

Set to an id of a command element that is being observed by the element.

型 : element id

この要素に観察されている command 要素の id を設定する。

disabled

Type: boolean

Set to true to disable the key. This is often used with a broadcaster to disable a menu command and key at the same time.

型 : boolean

true に設定すると、キーを無効にする。メニューコマンドとキーを同時に無効にするために、ブロードキャスターでしばしば使われる。

key

Type: character

The character that is must be pressed. This should be set to a displayable character.

型 : character

押さなければならない文字。表示可能な文字に設定する必要がある。

keycode

Type: string key code

For keys that do not have displayable characters, such as the enter key or function keys, use this attribute, instead of the key attribute. Valid keys are listed here.

型 : string key code

Enter キーや function キーのような、表示可能な文字を持たないキーに対しては、key 属性の代わりにこの属性を用いる。妥当なキーは ここ にリストされている。

keytext

Type: string

A label for the keyboard shortcut. This text would appear next to a menuitem label if that menuitem is associated with the key element via its key attribute.

型 : string

キーボードショートカット用のラベル。メニュー項目が key 属性を通じて key 要素と関係する場合、このテキストはメニュー項目のラベルの後に表示される。

modifiers

Type: space separated list of the values below

A list of modifier keys that should be pressed to invoke the keyboard shortcut. Multiple keys may be separated by spaces or commas. Keys will map to other keys on platforms that do not have them.

  • shift: The Shift key.
  • alt: The Alt key. On the Macintosh, this is the Option key.
  • meta: The Meta key. On the Macintosh, this is the Command key.
  • control: The Control key.
  • accel: The key used for keyboard shortcuts on the user's platform. Usually, this would be the value you would use.

型 : space separated list of the values below

キーボードショートカットを起動するために押す必要のある修飾キーのリスト。スペースかコンマで区切って、複数のキーを指定することができる。そのキーがないプラットフォームでは、他のキーにマップされる。

  • shift: Shift キー。
  • alt: Alt キー。 Macintosh では Option キーである。
  • meta: Meta キー。 Macintosh では Command キーである。
  • control: Control キー。
  • accel: ユーザのプラットフォームでキーボードショートカットに使われるキー。通常は使いたい値になる。
oncommand

Type: script code

This event handler is called when an element is activated. How it is activated varies for each element and in many cases, there are several ways to activate an element. For example, a button can be activated by clicking on it with the mouse or by pressing ENTER while it has the focus. Menus can be activated by selecting them with the mouse or by pressing a shortcut key. You should always use the oncommand event instead of onclick because it will be called in all of the needed cases.

型 : script code

要素がアクティベイトされたときに、このイベントハンドラは呼ばれる。どうアクティベイトされるかは個々の要素によって変化するが、多くの場合には複数の方法がある。たとえばボタンは、マウスでクリックすることでアクティベイトされるし、フォーカスがある間に ENTER を押すことでもアクティベイトされうる。メニューは、マウスで選択することでアクティベイトされるし、ショートカットキーを押すことでもアクティベイトされる。このイベントハンドラは必要とされる場合すべてで呼ばれるため、常に onclick の代わりに oncommand イベントを使用すべきである。

phase

Type: string

The event phase where the handler is invoked. This should be set to the value 'capturing' to indicate during the event capturing phase or 'target' to indicate at the target element or left out entirely for the bubbling phase.

型 : string

ハンドラが起動されるイベントフェイズ。イベントキャプチャ・フェイズの間を指定するには値 'capturing' を設定、ターゲット要素でを指定するには値 'target' を設定、バブリング・フェイズを指定するには取り除く必要がある。


プロパティとメソッド:

XUL Element から継承:

align allowEvents blur boxObject boxObject.element
boxObject.getLookAndFeelMetric boxObject.height boxObject.screenX boxObject.screenY boxObject.width
boxObject.x boxObject.y builder className click
collapsed contextMenu controllers database datasources
dir doCommand flex focus getElementsByAttribute
height hidden id left maxHeight
maxWidth menu minHeight minWidth observes
ordinal orient pack persist ref
resource statusText style tooltip tooltipText
top width

Element から継承:

addEventListener
appendChild
attributes
childNodes
cloneNode
dispatchEvent
firstChild
getAttribute
getAttributeNS
getAttributeNode
getAttributeNodeNS
getElementsByTagName
getElementsByTagNameNS
hasAttribute
hasAttributeNS
hasAttributes
hasChildNodes
insertBefore
isSupported
lastChild
localName
namespaceURI
nextSibling
nodeName
nodeType
nodeValue
normalize
ownerDocument
parentNode
prefix
previousSibling
removeAttribute
removeAttributeNS
removeAttributeNode
removeChild
removeEventListener
replaceChild
setAttribute
setAttributeNS
setAttributeNode
setAttributeNodeNS
tagName

Copyright (C) 1999 - 2004 XulPlanet.com