CPInput

org.cosplay.CPInput
trait CPInput

Interface for the external input devices such as joysticks and game pads.

You can add support for such devices by calling CPEngine.addInput and CPEngine.removeInput methods on the game engine. Note that keyboard support is built into CosPlay and you don't need to do anything additional to access it. This interface is designed to add additional external input devices that are not automatically supported by CosPlay.

Attributes

See also
Source
CPInput.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def poll(ctx: CPInputContext): Option[CPKeyboardKey]

Implementation should poll the external input devices and return a keyboard event representing the the original input event, if any. Note that if the input is registered with the engine its events (from this method) will override the built-in keyboard events happened in the same frame.

Implementation should poll the external input devices and return a keyboard event representing the the original input event, if any. Note that if the input is registered with the engine its events (from this method) will override the built-in keyboard events happened in the same frame.

Value parameters

ctx

Current input context.

Attributes

Returns

Keyboard event that represents the event from the external input device.

Source
CPInput.scala