Fan

 

const class

fwt::Key

sys::Obj
  fwt::Key

@simple
@js

Key models a keyboard key or key combination.

Slots

aSource

static Key a := Key.predefine(97, "A")

altSource

static Key alt := Key.predefine(65536, "Alt")

bSource

static Key b := Key.predefine(98, "B")

backspaceSource

static Key backspace := Key.predefine(8, "Backspace")

cSource

static Key c := Key.predefine(99, "C")

capsLockSource

static Key capsLock := Key.predefine(16777298, "CapsLock")

commandSource

static Key command := Key.predefine(4194304, "Command")

ctrlSource

static Key ctrl := Key.predefine(262144, "Ctrl")

dSource

static Key d := Key.predefine(100, "D")

deleteSource

static Key delete := Key.predefine(127, "Del")

downSource

static Key down := Key.predefine(16777218, "Down")

eSource

static Key e := Key.predefine(101, "E")

endSource

static Key end := Key.predefine(16777224, "End")

enterSource

static Key enter := Key.predefine(13, "Enter")

equalsSource

override Bool equals(Obj? that)

Overrides sys::Obj.equals

Equality is based on keycode.

escSource

static Key esc := Key.predefine(27, "Esc")

fSource

static Key f := Key.predefine(102, "F")

f1Source

static Key f1 := Key.predefine(16777226, "F1")

f10Source

static Key f10 := Key.predefine(16777235, "F10")

f11Source

static Key f11 := Key.predefine(16777236, "F11")

f12Source

static Key f12 := Key.predefine(16777237, "F12")

f2Source

static Key f2 := Key.predefine(16777227, "F2")

f3Source

static Key f3 := Key.predefine(16777228, "F3")

f4Source

static Key f4 := Key.predefine(16777229, "F4")

f5Source

static Key f5 := Key.predefine(16777230, "F5")

f6Source

static Key f6 := Key.predefine(16777231, "F6")

f7Source

static Key f7 := Key.predefine(16777232, "F7")

f8Source

static Key f8 := Key.predefine(16777233, "F8")

f9Source

static Key f9 := Key.predefine(16777234, "F9")

fromStrSource

static Key? fromStr(Str s, Bool checked := true)

Parse font from string (see toStr). If invalid and checked is true then throw ParseErr otherwise return null.

gSource

static Key g := Key.predefine(103, "G")

hSource

static Key h := Key.predefine(104, "H")

hasModifierSource

Bool hasModifier()

Return if any of the modifier keys are down.

hashSource

override Int hash()

Overrides sys::Obj.hash

Hash code is based on keycode.

homeSource

static Key home := Key.predefine(16777223, "Home")

iSource

static Key i := Key.predefine(105, "I")

insertSource

static Key insert := Key.predefine(16777225, "Insert")

isAltSource

Bool isAlt()

Convenience for isDown(alt)

isCommandSource

Bool isCommand()

Convenience for isDown(comand)

isCtrlSource

Bool isCtrl()

Convenience for isDown(ctrl)

isDownSource

Bool isDown(Key modifier)

Return if the specified modifier is down.

isModifierSource

Bool isModifier()

Is this instance is a modifier which may be combined with other keys: shift, alt, ctrl, command.

isShiftSource

Bool isShift()

Convenience for isDown(shift)

jSource

static Key j := Key.predefine(106, "J")

kSource

static Key k := Key.predefine(107, "K")

keypad0Source

static Key keypad0 := Key.predefine(16777264, "Keypad0")

keypad1Source

static Key keypad1 := Key.predefine(16777265, "Keypad1")

keypad2Source

static Key keypad2 := Key.predefine(16777266, "Keypad2")

keypad3Source

static Key keypad3 := Key.predefine(16777267, "Keypad3")

keypad4Source

static Key keypad4 := Key.predefine(16777268, "Keypad4")

keypad5Source

static Key keypad5 := Key.predefine(16777269, "Keypad5")

keypad6Source

static Key keypad6 := Key.predefine(16777270, "Keypad6")

keypad7Source

static Key keypad7 := Key.predefine(16777271, "Keypad7")

keypad8Source

static Key keypad8 := Key.predefine(16777272, "Keypad8")

keypad9Source

static Key keypad9 := Key.predefine(16777273, "Keypad9")

keypadDivSource

static Key keypadDiv := Key.predefine(16777263, "Keypad/")

keypadDotSource

static Key keypadDot := Key.predefine(16777262, "Keypad.")

keypadEnterSource

static Key keypadEnter := Key.predefine(16777296, "KeypadEnter")

keypadEqualSource

static Key keypadEqual := ")

keypadMinusSource

static Key keypadMinus := Key.predefine(16777261, "Keypad-")

keypadMultSource

static Key keypadMult := Key.predefine(16777258, "Keypad*")

keypadPlusSource

static Key keypadPlus := Key.predefine(16777259, "Keypad+")

lSource

static Key l := Key.predefine(108, "L")

leftSource

static Key left := Key.predefine(16777219, "Left")

listSource

Key[] list()

Decompose a key combination into its individual keys. If instance isn't a combination then return a list with one item (this instance).

mSource

static Key m := Key.predefine(109, "M")

modifiersSource

Key modifiers()

Return a Key instance with only the modifiers.

nSource

static Key n := Key.predefine(110, "N")

num0Source

static Key num0 := Key.predefine(48, "0")

num1Source

static Key num1 := Key.predefine(49, "1")

num2Source

static Key num2 := Key.predefine(50, "2")

num3Source

static Key num3 := Key.predefine(51, "3")

num4Source

static Key num4 := Key.predefine(52, "4")

num5Source

static Key num5 := Key.predefine(53, "5")

num6Source

static Key num6 := Key.predefine(54, "6")

num7Source

static Key num7 := Key.predefine(55, "7")

num8Source

static Key num8 := Key.predefine(56, "8")

num9Source

static Key num9 := Key.predefine(57, "9")

numLockSource

static Key numLock := Key.predefine(16777299, "NumLock")

oSource

static Key o := Key.predefine(111, "O")

pSource

static Key p := Key.predefine(112, "P")

pageDownSource

static Key pageDown := Key.predefine(16777222, "PageDown")

pageUpSource

static Key pageUp := Key.predefine(16777221, "PageUp")

pauseSource

static Key pause := Key.predefine(16777301, "Pause")

plusSource

Key plus(Key x)

Add two keys to create a new key combination. Throws ArgErr if neither this nor x returns true true for isModifier.

printScreenSource

static Key printScreen := Key.predefine(16777303, "PrintScreen")

qSource

static Key q := Key.predefine(113, "Q")

rSource

static Key r := Key.predefine(114, "R")

replaceSource

Key replace(Key modFrom, Key modTo)

Replace one modifier with another modifer. If modFrom is not defined in this key, then return this.

static Key right := Key.predefine(16777220, "Right")

sSource

static Key s := Key.predefine(115, "S")

scrollLockSource

static Key scrollLock := Key.predefine(16777300, "ScrollLock")

shiftSource

static Key shift := Key.predefine(131072, "Shift")

spaceSource

static Key space := Key.predefine(32, "Space")

tSource

static Key t := Key.predefine(116, "T")

tabSource

static Key tab := Key.predefine(9, "Tab")

toStrSource

override Str toStr()

Overrides sys::Obj.toStr

Format as key names combined with "+" symbol.

uSource

static Key u := Key.predefine(117, "U")

upSource

static Key up := Key.predefine(16777217, "Up")

vSource

static Key v := Key.predefine(118, "V")

wSource

static Key w := Key.predefine(119, "W")

xSource

static Key x := Key.predefine(120, "X")

ySource

static Key y := Key.predefine(121, "Y")

zSource

static Key z := Key.predefine(122, "Z")