sdljava.event

Class SDLKeyboardEvent

public class SDLKeyboardEvent extends SDLEvent

A keyboard event occurs when a key is released (type=SDK_KEYUP or state=SDL_RELEASED) and when a key is pressed (type=SDL_KEYDOWN or state=SDL_PRESSED). The information on what key was pressed or released is in the keysym member.

Note: Repeating SDL_KEYDOWN events will occur if key repeat is enabled (see SDL_EnableKeyRepeat).

Version: $Id: SDLKeyboardEvent.java,v 1.13 2005/01/25 02:50:45 ivan_ganza Exp $

Author: Ivan Z. Ganza

Field Summary
SDLModcachedMod
shortcachedScancode
intcachedSym
intcachedUnicode
SDL_KeyboardEventswigKeyboardEvent
Reference to the SWIG generated Keyboard Event
Method Summary
SDLModgetMod()
Current key modifiers
shortgetScancode()
Return the Hardware specific scancode
SDLPressedStategetState()
Get the state of the button
SDL_KeyboardEventgetSwigKeyboardEvent()
Gets the value of swigKeyboardEvent
intgetSym()
SDL virtual keysym
intgetType()
The type of the this event
intgetUnicode()
Translated Unicode character
voidsetSwigKeyboardEvent(SDL_KeyboardEvent argSwigKeyboardEvent)
Sets the value of swigKeyboardEvent
StringtoString()

Field Detail

cachedMod

SDLMod cachedMod

cachedScancode

short cachedScancode

cachedSym

int cachedSym

cachedUnicode

int cachedUnicode

swigKeyboardEvent

SDL_KeyboardEvent swigKeyboardEvent
Reference to the SWIG generated Keyboard Event

Method Detail

getMod

public SDLMod getMod()
Current key modifiers

Returns: The Current key modifiers

getScancode

public short getScancode()
Return the Hardware specific scancode

Returns: Hardware specific scancode

getState

public SDLPressedState getState()
Get the state of the button

Returns: the state of the button

getSwigKeyboardEvent

public SDL_KeyboardEvent getSwigKeyboardEvent()
Gets the value of swigKeyboardEvent

Returns: the value of swigKeyboardEvent

getSym

public int getSym()
SDL virtual keysym

Returns: The SDL virtual keysym

getType

public int getType()
The type of the this event

Returns: The type of event

getUnicode

public int getUnicode()
Translated Unicode character

Returns: The Translated Unicode character

setSwigKeyboardEvent

public void setSwigKeyboardEvent(SDL_KeyboardEvent argSwigKeyboardEvent)
Sets the value of swigKeyboardEvent

Parameters: argSwigKeyboardEvent Value to assign to this.swigKeyboardEvent

toString

public String toString()

Returns: a String representation of myself