public abstract class CanvasCore extends CanvasSoftkeys
Modifier and Type | Field and Description |
---|---|
static int |
app_status |
static int |
APPSTATE_INIT
The initial state of the application when the application is loading up - nothing will be rendered in this state
|
static int |
APPSTATUSFLAG_INTERRUPTED_BY_UNKNOWN |
static int |
APPSTATUSFLAG_PAUSED |
static CanvasCore |
instance
Our instance
|
static int |
KEYFLAG_0
The bitflag that will be set in keys_pressed and keys_repeated when the appropriate key is used.
|
static int |
KEYFLAG_1
The bitflag that will be set in keys_pressed and keys_repeated when the appropriate key is used.
|
static int |
KEYFLAG_2
The bitflag that will be set in keys_pressed and keys_repeated when the appropriate key is used.
|
static int |
KEYFLAG_3
The bitflag that will be set in keys_pressed and keys_repeated when the appropriate key is used.
|
static int |
KEYFLAG_4
The bitflag that will be set in keys_pressed and keys_repeated when the appropriate key is used.
|
static int |
KEYFLAG_5
The bitflag that will be set in keys_pressed and keys_repeated when the appropriate key is used.
|
static int |
KEYFLAG_6
The bitflag that will be set in keys_pressed and keys_repeated when the appropriate key is used.
|
static int |
KEYFLAG_7
The bitflag that will be set in keys_pressed and keys_repeated when the appropriate key is used.
|
static int |
KEYFLAG_8
The bitflag that will be set in keys_pressed and keys_repeated when the appropriate key is used.
|
static int |
KEYFLAG_9
The bitflag that will be set in keys_pressed and keys_repeated when the appropriate key is used.
|
static int |
KEYFLAG_DELETE
The bitflag that will be set in keys_pressed and keys_repeated when the appropriate key is used.
|
static int |
KEYFLAG_DOWN
The bitflag that will be set in keys_pressed and keys_repeated when the appropriate key is used.
|
static int |
KEYFLAG_FIRE
The bitflag that will be set in keys_pressed and keys_repeated when the appropriate key is used.
|
static int |
KEYFLAG_HASH
The bitflag that will be set in keys_pressed and keys_repeated when the appropriate key is used.
|
static int |
KEYFLAG_LEFT
The bitflag that will be set in keys_pressed and keys_repeated when the appropriate key is used.
|
static int |
KEYFLAG_RIGHT
The bitflag that will be set in keys_pressed and keys_repeated when the appropriate key is used.
|
static int |
KEYFLAG_RIGHT_MOUSE_CLICK
The bitflag that will be set in keys_pressed and keys_repeated when the appropriate key is used.
|
static int |
KEYFLAG_SELECT
The bitflag that will be set in keys_pressed and keys_repeated when the appropriate key is used.
|
static int |
KEYFLAG_SOFTKEYBACK
The bitflag that will be set in keys_pressed and keys_repeated when the appropriate key is used.
|
static int |
KEYFLAG_SOFTKEYFWRD
The bitflag that will be set in keys_pressed and keys_repeated when the appropriate key is used.
|
static int |
KEYFLAG_STAR
The bitflag that will be set in keys_pressed and keys_repeated when the appropriate key is used.
|
static int |
KEYFLAG_START
The bitflag that will be set in keys_pressed and keys_repeated when the appropriate key is used.
|
static int |
KEYFLAG_UP
The bitflag that will be set in keys_pressed and keys_repeated when the appropriate key is used.
|
static int |
KEYFLAG_VOLUMEDOWN
The bitflag that will be set in keys_pressed and keys_repeated when the appropriate key is used.
|
static int |
KEYFLAG_VOLUMEUP
The bitflag that will be set in keys_pressed and keys_repeated when the appropriate key is used.
|
static int |
keys_pressed
Bitflag data that will be consistent for this one-update - use in app.
|
static int |
keys_repeated
Bitflag data that will be consistent for this one-update - use in app.
|
static int |
loading_progress
Feel free to use this to record the progress of your loading bars
|
static boolean |
pointer_pressed
Same as keys_, but used for the pointer
|
static boolean |
pointer_repeated
Same as keys_, but used for the pointer
|
static int |
pointer_x
The last recorded position of the pointer for touchscreen handsets
|
static int |
pointer_y
The last recorded position of the pointer for touchscreen handsets
|
static boolean |
QATESTS_ENABLED
Set if any of the QATests are set - if no QATests are used, bits of code can be removed to detect them
|
static int |
qatests_triggered
(1 << 0) is set if QATEST0 is triggered, (1 << 1) is set if QATEST1 is triggered, ...
|
static long |
regions_pressed |
static long |
regions_repeated |
static boolean |
render_after_update
Set this to false if you do not want a render to occur after this update
|
static int |
SIZE_TOUCHSCREEN_REGION_INFO
Index information into the touchscreen_regions array
|
static int |
TOUCHSCREEN_REGION_INFO_BRX
Index information into the touchscreen_regions array
|
static int |
TOUCHSCREEN_REGION_INFO_BRY
Index information into the touchscreen_regions array
|
static int |
TOUCHSCREEN_REGION_INFO_KEYFLAGS
Index information into the touchscreen_regions array
|
static int |
TOUCHSCREEN_REGION_INFO_TLX
Index information into the touchscreen_regions array
|
static int |
TOUCHSCREEN_REGION_INFO_TLY
Index information into the touchscreen_regions array
|
static int[] |
touchscreen_regions |
back_softkey_string, fwrd_softkey_string, NEED_TO_RENDER_SOFTKEYS, softkey_add_back, softkey_add_fwrd
app_state, APPSTATEFLAG_LOADING, last_fixed_update_time_ms, last_variable_update_time_ms, main_thread, MS_PER_UPDATE, previous_app_state
internal_key_mappings
CURRENT_SCREEN_HEIGHT, CURRENT_SCREEN_PPI, CURRENT_SCREEN_WIDTH, UPDATE_SCREEN_DIMENSIONS
Constructor and Description |
---|
CanvasCore() |
Modifier and Type | Method and Description |
---|---|
void |
changeAppStateTo(int new_app_state)
Call this to change the app_state.
|
void |
clearTouchscreenRegion(int region_id)
Clears a touchscreen region from spoofing any future keypresses
|
void |
fixedRateUpdate()
Optional update method which is called at a regular framerate
|
void |
hideNotify()
One of the various ways the phone might tell you of an incoming interrupt
|
void |
keyAction(int key_bit_flag,
boolean pressed)
Either a key has been pressed, or released.
|
void |
pointerAction(int x,
int y,
boolean pressed)
Either a pointer has been pressed, dragged or released
|
void |
pointerDragged(int x,
int y)
Deal with any pointer drags
|
void |
quit()
Deprecated.
|
void |
releaseAllKeys()
Releases all keys
|
void |
runOnce()
One cycle of the main run method that controls the frame-rate throttling and calls the update and synchronised render methods
|
int |
setTouchscreenRegion(int tlx,
int tly,
int width,
int height,
int keyflags)
Set a region on screen that when touched, dragged and released inside with a pointer will spoof a given set of keypresses
|
void |
showNotify()
One of the various ways the phone might tell you of recovering from an interrupt
|
void |
sleep(int ms)
Performs a thread sleep (or yield if ms <= 0)
|
void |
variableRateUpdate(long ms)
Optional update method which is passed in the ms passed since the last update call.
|
setSoftkeys
run, startLoading, startMainThread, stopMainThread
findKeyBitflag, initKeysAndTouch, keyPressed, keyReleased, pointerPressed, pointerReleased
initInterrupts
updateScreenDimensions
paint, render, sizeChanged, syncPaint
flushGraphics, flushGraphics, getKeyStates
getGameAction, getHeight, getKeyCode, getKeyName, getWidth, hasPointerEvents, hasPointerMotionEvents, hasRepeatEvents, isDoubleBuffered, repaint, repaint, serviceRepaints, setFullScreenMode
public static CanvasCore instance
public static final int APPSTATE_INIT
public static final int APPSTATUSFLAG_PAUSED
public static final int APPSTATUSFLAG_INTERRUPTED_BY_UNKNOWN
public static final int KEYFLAG_0
public static final int KEYFLAG_1
public static final int KEYFLAG_2
public static final int KEYFLAG_3
public static final int KEYFLAG_4
public static final int KEYFLAG_5
public static final int KEYFLAG_6
public static final int KEYFLAG_7
public static final int KEYFLAG_8
public static final int KEYFLAG_9
public static final int KEYFLAG_HASH
public static final int KEYFLAG_STAR
public static final int KEYFLAG_DELETE
public static final int KEYFLAG_SELECT
public static final int KEYFLAG_START
public static final int KEYFLAG_LEFT
public static final int KEYFLAG_RIGHT
public static final int KEYFLAG_UP
public static final int KEYFLAG_DOWN
public static final int KEYFLAG_FIRE
public static final int KEYFLAG_SOFTKEYFWRD
public static final int KEYFLAG_SOFTKEYBACK
public static final int KEYFLAG_VOLUMEUP
public static final int KEYFLAG_VOLUMEDOWN
public static final int KEYFLAG_RIGHT_MOUSE_CLICK
public static final int TOUCHSCREEN_REGION_INFO_TLX
public static final int TOUCHSCREEN_REGION_INFO_TLY
public static final int TOUCHSCREEN_REGION_INFO_BRX
public static final int TOUCHSCREEN_REGION_INFO_BRY
public static final int TOUCHSCREEN_REGION_INFO_KEYFLAGS
public static final int SIZE_TOUCHSCREEN_REGION_INFO
public static final boolean QATESTS_ENABLED
public static int keys_pressed
public static int keys_repeated
public static boolean pointer_pressed
public static boolean pointer_repeated
public static int pointer_x
public static int pointer_y
public static int[] touchscreen_regions
public static long regions_pressed
public static long regions_repeated
public static int qatests_triggered
public static int app_status
public static int loading_progress
public static boolean render_after_update
public void variableRateUpdate(long ms)
public void fixedRateUpdate()
public void changeAppStateTo(int new_app_state)
public void sleep(int ms)
public void hideNotify()
hideNotify
in class javax.microedition.lcdui.Canvas
public void showNotify()
showNotify
in class javax.microedition.lcdui.Canvas
public void releaseAllKeys()
public void quit()
public void runOnce()
runOnce
in class CanvasThreading
public void keyAction(int key_bit_flag, boolean pressed)
keyAction
in class CanvasKeysAndTouch
key_bit_flag
- The bit-flag interpretation of the key pressedpublic void pointerAction(int x, int y, boolean pressed)
pointerAction
in class CanvasKeysAndTouch
public void pointerDragged(int x, int y)
pointerDragged
in class javax.microedition.lcdui.Canvas
public int setTouchscreenRegion(int tlx, int tly, int width, int height, int keyflags)
public void clearTouchscreenRegion(int region_id)