Skip to main content

altKey

Type​

function

Summary​

Returns the state of the Alt key.

Syntax​

the altKey
altKey()

Description​

Use the altKey function to check whether the Alt key, Meta key, or Option key is being pressed. You can use altKey to add alternative capabilities to user actions such as clicking.

The altKey, optionKey, and metaKey functions all return the same value. Which one to use is a matter of preference. The terminology varies depending on platform. Users of different operating systems may know this key as the Option key (Mac OS systems), Meta key (Unix systems), or Alt key (Windows systems).

Examples​

put the altKey into keyState
if the altKey is down then exit mouseUp
repeat until altKey() = up

Value​

NameTypeDescription

return

The altKey function returns down if the key is pressed and up if it's not.

message: optionKeyDown

constant: return

control structure: function

function: optionKey, value, keysDown

glossary: Meta key, return, function, Alt key, Option key

Compatibility and Support​

Introduced

LiveCode 1.0

OS

mac

windows

linux

Platforms

desktop

server

Thank you for your feedback!

Was this page helpful?