sdljava.event
Class SDLKeyboardEvent

java.lang.Object
  extended by sdljava.event.SDLEvent
      extended by sdljava.event.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
(package private)  SDLMod cachedMod
           
(package private)  short cachedScancode
           
(package private)  int cachedSym
           
(package private)  int cachedUnicode
           
(package private)  SDL_KeyboardEvent swigKeyboardEvent
          Reference to the SWIG generated Keyboard Event
 
Fields inherited from class sdljava.event.SDLEvent
activeEvent, dummyEvent, exposeEvent, joyAxisEvent, joyBallEvent, joyButtonEvent, joyHatEvent, mouseButtonEvent, mouseMotionEvent, quitEvent, resizeEvent, SDL_ACTIVEEVENT, SDL_ACTIVEEVENTMASK, SDL_ADDEVENT, SDL_APPACTIVE, SDL_APPINPUTFOCUS, SDL_APPMOUSEFOCUS, SDL_BUTTON_LEFT, SDL_BUTTON_MIDDLE, SDL_BUTTON_RIGHT, SDL_BUTTON_WHEELDOWN, SDL_BUTTON_WHEELUP, SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL, SDL_DISABLE, SDL_ENABLE, SDL_GETEVENT, SDL_IGNORE, SDL_JOYAXISMOTION, SDL_JOYAXISMOTIONMASK, SDL_JOYBALLMOTION, SDL_JOYBALLMOTIONMASK, SDL_JOYBUTTONDOWN, SDL_JOYBUTTONDOWNMASK, SDL_JOYBUTTONUP, SDL_JOYBUTTONUPMASK, SDL_JOYEVENTMASK, SDL_JOYHATMOTION, SDL_JOYHATMOTIONMASK, SDL_KEYDOWN, SDL_KEYDOWNMASK, SDL_KEYUP, SDL_KEYUPMASK, SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONDOWNMASK, SDL_MOUSEBUTTONUP, SDL_MOUSEBUTTONUPMASK, SDL_MOUSEEVENTMASK, SDL_MOUSEMOTION, SDL_MOUSEMOTIONMASK, SDL_NOEVENT, SDL_PEEKEVENT, SDL_PRESSED, SDL_QUERY, SDL_QUIT, SDL_QUITMASK, SDL_RELEASED, SDL_SYSWMEVENT, SDL_SYSWMEVENTMASK, SDL_USEREVENT, SDL_VIDEOEXPOSE, SDL_VIDEOEXPOSEMASK, SDL_VIDEORESIZE, SDL_VIDEORESIZEMASK, sdlKeyboardEvent, swigEvent, sysWMEvent, userEvent
 
Constructor Summary
SDLKeyboardEvent()
           
 
Method Summary
 SDLMod getMod()
          Current key modifiers
 short getScancode()
          Return the Hardware specific scancode
 SDLPressedState getState()
          Get the state of the button
 SDL_KeyboardEvent getSwigKeyboardEvent()
          Gets the value of swigKeyboardEvent
 int getSym()
          SDL virtual keysym
 int getType()
          The type of the this event
 int getUnicode()
          Translated Unicode character
 void setSwigKeyboardEvent(SDL_KeyboardEvent argSwigKeyboardEvent)
          Sets the value of swigKeyboardEvent
 java.lang.String toString()
           
 
Methods inherited from class sdljava.event.SDLEvent
enableKeyRepeat, enableUNICODE, eventState, getAppState, getKeyName, getModState, getMouseState, getRelativeMouseState, joystickEventState, pollEvent, pollEvent, processEvent, pumpEvents, setModState, waitEvent, waitEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

swigKeyboardEvent

SDL_KeyboardEvent swigKeyboardEvent
Reference to the SWIG generated Keyboard Event


cachedScancode

short cachedScancode

cachedSym

int cachedSym

cachedMod

SDLMod cachedMod

cachedUnicode

int cachedUnicode
Constructor Detail

SDLKeyboardEvent

public SDLKeyboardEvent()
Method Detail

getSwigKeyboardEvent

public SDL_KeyboardEvent getSwigKeyboardEvent()
Gets the value of swigKeyboardEvent

Returns:
the value of swigKeyboardEvent

setSwigKeyboardEvent

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

Parameters:
argSwigKeyboardEvent - Value to assign to this.swigKeyboardEvent

getScancode

public short getScancode()
Return the Hardware specific scancode

Returns:
Hardware specific scancode

getSym

public int getSym()
SDL virtual keysym

Returns:
The SDL virtual keysym

getUnicode

public int getUnicode()
Translated Unicode character

Returns:
The Translated Unicode character

getMod

public SDLMod getMod()
Current key modifiers

Returns:
The Current key modifiers

getState

public SDLPressedState getState()
Get the state of the button

Returns:
the state of the button

getType

public int getType()
The type of the this event

Specified by:
getType in class SDLEvent
Returns:
The type of event

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
a String representation of myself