UnicodeResponder:
Filter:
crucial-library/Classes (extension) | External Control > Keyboard | Libraries > crucial > Keyboard

UnicodeResponder
ExtensionExtension

register responder functions for unicode and modifier combinations

Description

This can be used to replace a function in a view's keydownAction. It matches modifier/unicode combinations and then evaluates the matched handler.

This is one of the simplest ways to accurately match the exact modifier combination you want.

If you merely check the modifier like so: (modifer & optionModifier ) == optionModifier or modifier.isAlt

then you will detect the presence of the options key, but not if ONLY the option key is present ( ie. it will match for shift-option as well )

see KeyCodeResponder

true: must be pressed false: must not be pressed nil: can be either pressed or not pressed

Use this to post the codes:

Class Methods

.new

.register

Arguments:

unicode
shift
caps
opt
cntl
function

.clear

.remove

.registerUnicode

Arguments:

modifier
unicode
function

.registerUnicodeAll

Arguments:

... sets

.registerAll

Arguments:

... sets

.tester

.at

Arguments:

address

.put

Arguments:

address
val

.pushForUnicode

Arguments:

unicode
requireMask
denyMask
function
description

.resetUnicode

Arguments:

unicode

.value

Arguments:

view
char
modifiers
unicode
keycode

.global

Instance Methods

.dict

.value

Arguments:

view
char
modifier
unicode
keycode

.normal

Arguments:

... assns

.shift

Arguments:

... assns

.control

Arguments:

... assns

.option

Arguments:

... assns

.register

Arguments:

unicode
shift
caps
opt
cntl
function
description

++

Arguments:

that

.registerUnicode

Arguments:

modifier
unicode
function

.registerUnicodeAll

Arguments:

... sets

.clear

.remove

.at

Arguments:

key

.put

Arguments:

key
value

.pushForUnicode

Arguments:

unicode
requireMask
denyMask
function
description

.guiClass

.report

Examples

The view in this example is merely to have something to focus on, it does nothing else.

Note that to match shift-a you have to specify "A", not "a"

You can also specify with ascii characters