XModifierKeys Reference

XModifierKeys is a library to obtain status of modifier keys.

This library allow to scripts change the behavior depending of the status of modifier keys.

Example

use XModifierKeys : script "XModifierKeys"

delay 1 -- provide time to press keys
tell (make XModifierKeys)
if is_command_pressed() then log "Command key is pressed"
if is_option_pressed() then log "Option key is pressed"
if is_control_pressed() then log "Control key is pressed"
if is_function_pressed() then log "Function key is pressed"
if is_shift_pressed() then log "Shift key is pressed"
if is_capslock_pressed() then log "Caps lock key is pressed"
end tell

Constructor Method

make

Make an instance of XModifierKeys and caputre current status of modifier keys.

Instance Methods

is_command_pressed

Return true if command key is pressed.

is_option_pressed

Return true if option key is pressed.

is_control_pressed

Return true if control key is pressed.

is_function_pressed

Return true if function key is pressed.

is_shift_pressed

Return true if shift key is pressed.

is_capslock_pressed

Return true if caps lock is on.