Game Input

1.Summary

9256-close-up-of-a-white-keyboard-pv

 

“I have yet to play a game in which I can not communicate with it”-anonymous

The Game Pencil Engine handle’s user input in a cross-platform manner. Making sure your touch-screen, keyboard, mouse and game controller(Wii U export) has been simplified on a per frame basis.

2.Input Functions

The Keyboard

 

gpe.check_keyboard_down = function(keyId)

-Returns true or false if the key is being pressed now.

gpe.check_keyboard_pressed = function(keyId)
-Returns true or false if the key was just pressed in frame.

gpe.check_keyboard_released(keyId)
-Returns true or false if the key was just released in frame.

You can find the complete list of keyboard constants here.

 

The Mouse

gpe.check_mouse_button_down = function(buttonId)

-Returns true or false if the mouse button is being pressed now.

gpe.check_mouse_button_pressed = function(buttonId)
-Returns true or false if the mouse buttonwas just pressed in frame.

gpe.check_mouse_button_released(buttonId)
-Returns true or false if the mouse button was just released in frame.

 

Mouse buttons are indexed from 0 to 2.

 

Mouse Button ( 0 ) = Left Button

Mouse Button ( 1 ) = Middle Button

Mouse Button ( 2 ) = Right Button

Suggest Edit