Skip to content
instance method

IO#pressed?

(::Integer | ::interned) -> bool
io.pressed?(key) → bool

Returns true if key is pressed. key may be a virtual key code or its name (String or Symbol) with out “VK_” prefix.

This method is Windows only.

You must require ‘io/console’ to use this method.

See also #pread #print #pos= #printf also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0