NAME

Graphics::Raylib::Keyboard - Deal with Keyboard Input

VERSION

version 0.025

SYNOPSIS

use Graphics::Raylib::Keyboard ':all';

print "A is pressed down\n" if key_down 'a';
print "B is not being pressed down\n" if key_up 'a';
print "last key pressed is ", key_pressed, "\n";

DESCRIPTION

Keys are specified in Vi-like notation. Keys returned are instances of Graphics::Raylib::Key which has the eq operator overloaded, so you don't have to care about letter case and synonyms (e.g. <CR>, <Return> and <Enter>

METHODS AND ARGUMENTS

key_pressed([$key])

Returns last pressed key. if a $key argument is supplied, detects if that given key has been pressed once.

key_down($key)

Detects if key is being pressed down

key_released($key)

Detects if a key has been released once

key_up($key)

Detects if a key is NOT being pressed

$exit = exit_key() or exit_key("<Esc>")

getter/setter for the key used to exit the program

print "Exit key is ",  Graphics::Raylib::Keyboard::exit_key, "\n";
Graphics::Raylib::Keyboard::exit_key("<Enter>"); # Instead of the default "<Esc>"

GIT REPOSITORY

http://github.com/athreef/Graphics-Raylib

SEE ALSO

Graphics-Raylib

Graphics-Raylib-XS

AUTHOR

Ahmad Fatoum <athreef@cpan.org>, http://a3f.at

COPYRIGHT AND LICENSE

Copyright (C) 2017 Ahmad Fatoum

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.