Skip to content

Documentation: Input

OkiStuff edited this page Jul 18, 2020 · 2 revisions

Documentation: Input

The Input class is what adds functionality to your projects. Making them more useful and more enjoyable to use.

KeyPressed()

the KeyPressed() Method returns a true or a false depending if the key pressed is the key requested

Parmas:

  • key: Key you want to see if it gets pressed. Type: STRING

Usage:

require 'ConsoleGL'

# loop
while true do
    if Input.KeyPressed("a")
        puts "CORRECT KEY PRESSED"
    else
        puts "INCORRECT KEY PRESSED"
    end
end

Clone this wiki locally