{WEBSITE :D}

Key Input Module

Version 1.00

Glitchfinder's Key Input Module is an advanced scripting tool that provides full scripted acess to to check any and all keys on the keyboard, along with the ability to check if a key has been released.

Features

Screenshots

This script has no visual elements. Therefore, screenshots are unnecessary.

Script

The script can be found here.

Instructions

Place this script above Main, and below the default scripts. (I realize this is obvious to most, but some people don't get it.)

This module is automatically updated by the default Input module, which means that the only time you need to call the update method is in a scene that does not update the default Input module.

This module does not break the functionality of the default Input module.

If you wish to read keys from a gamepad, you must still use the default input module to do so.

To use this module, simply use one of the four methods (press?(key), trigger?(key), repeat?(key), or release?(key)), where key is the index of the key you want to check. Key may also be used as Keys::KEYNAME. For a list of acceptable key names, look below the header.

Method List

Keys.update

Updates keyboard input. Calls to this method are not necessary unless the default Input module is not being updated.

Keys.press?(key)

Determines whether the button determined by key is currently being pressed. If the button is being pressed, returns true. If not, returns false.

Keys.trigger?(key)

Determines whether the button determined by key is being pressed again. "Pressed again" is seen as time having passed between the button being not pressed and being pressed. If the button is being pressed, returns true. If not, returns false.

Keys.repeat?(key)

Determines whether the button determined by key is being pressed again. Unlike trigger?(), this takes into account the repeat input of a button being held down continuously. If the button is being pressed, returns true. If not, returns false.

Keys.release?(key)

Determines whether the button determined by key has just been released. If the button has been released, returns true. If not, returns false.

Terms and Conditions

http://www.glitchkey.com
http://www.hbgames.org

Site Software ©2010 Brian Labbe