sdljava.event

Class SDLMod

public class SDLMod extends Object

Set of possible key modifiers(mods)

Version: $Id: SDLMod.java,v 1.8 2005/01/19 03:09:12 ivan_ganza Exp $

Author: Ivan Z. Ganza

Field Summary
static MapmodCache
cache of SDLMod instances, one for each possible mods values
intmods
valid key mods (possibly OR'd together)
Constructor Summary
SDLMod(int mods)
Creates a new SDLMod instance.
Method Summary
booleanalt()
booleancaps()
booleanctrl()
static SDLModget(int mods)
Get the SDLMod instance identified by mods.
intgetState()
booleanleftAlt()
booleanleftCtrl()
booleanleftMeta()
booleanleftShift()
booleanmeta()
booleanmode()
booleannum()
booleanrightAlt()
booleanrightCtrl()
booleanrightMeta()
booleanrightShift()
booleanshift()
StringtoString()
StringtoStringBrief()

Field Detail

modCache

static Map modCache
cache of SDLMod instances, one for each possible mods values

mods

int mods
valid key mods (possibly OR'd together)

Constructor Detail

SDLMod

public SDLMod(int mods)
Creates a new SDLMod instance.

Parameters: mods valid key mods (possibly OR'd together)

Method Detail

alt

public boolean alt()

caps

public boolean caps()

ctrl

public boolean ctrl()

get

public static SDLMod get(int mods)
Get the SDLMod instance identified by mods. This method creates the SDLMod instance and caches it if it didn't already exist. Once created we won't need to create new SDLMod object instances each time a keyboard event occurs.

Parameters: mods valid key mods (possibly OR'd together)

Returns: The singleton SDLMod instance

getState

public int getState()

leftAlt

public boolean leftAlt()

leftCtrl

public boolean leftCtrl()

leftMeta

public boolean leftMeta()

leftShift

public boolean leftShift()

meta

public boolean meta()

mode

public boolean mode()

num

public boolean num()

rightAlt

public boolean rightAlt()

rightCtrl

public boolean rightCtrl()

rightMeta

public boolean rightMeta()

rightShift

public boolean rightShift()

shift

public boolean shift()

toString

public String toString()

toStringBrief

public String toStringBrief()