j2me如何判断没有按下手机按钮 5
1个回答
展开全部
keyPressed
protected void keyPressed(int keyCode)Called when a key is pressed.
The getGameAction() method can be called to determine what game action, if any, is mapped to the key. Class Canvas has an empty implementation of this method, and the subclass has to redefine it if it wants to listen this method.
Parameters:
keyCode - the key code of the key that was pressed
--------------------------------------------------------------------------------
keyRepeated
protected void keyRepeated(int keyCode)Called when a key is repeated (held down).
The getGameAction() method can be called to determine what game action, if any, is mapped to the key. Class Canvas has an empty implementation of this method, and the subclass has to redefine it if it wants to listen this method.
Parameters:
keyCode - the key code of the key that was repeated
See Also:
hasRepeatEvents()
--------------------------------------------------------------------------------
keyReleased
protected void keyReleased(int keyCode)Called when a key is released.
The getGameAction() method can be called to determine what game action, if any, is mapped to the key. Class Canvas has an empty implementation of this method, and the subclass has to redefine it if it wants to listen this method.
Parameters:
keyCode - the key code of the key that was released
--------------------------------------------------------------------------------
pointerPressed
protected void pointerPressed(int x,
int y)Called when the pointer is pressed.
The hasPointerEvents() method may be called to determine if the device supports pointer events. Class Canvas has an empty implementation of this method, and the subclass has to redefine it if it wants to listen this method.
Parameters:
x - the horizontal location where the pointer was pressed (relative to the Canvas)
y - the vertical location where the pointer was pressed (relative to the Canvas)
--------------------------------------------------------------------------------
pointerReleased
protected void pointerReleased(int x,
int y)Called when the pointer is released.
The hasPointerEvents() method may be called to determine if the device supports pointer events. Class Canvas has an empty implementation of this method, and the subclass has to redefine it if it wants to listen this method.
Parameters:
x - the horizontal location where the pointer was released (relative to the Canvas)
y - the vertical location where the pointer was released (relative to the Canvas)
--------------------------------------------------------------------------------
pointerDragged
protected void pointerDragged(int x,
int y)Called when the pointer is dragged.
The hasPointerMotionEvents() method may be called to determine if the device supports pointer events. Class Canvas has an empty implementation of this method, and the subclass has to redefine it if it wants to listen this method.
Parameters:
x - the horizontal location where the pointer was dragged (relative to the Canvas)
y - the vertical location where the pointer was dragged (relative to the Canvas)
protected void keyPressed(int keyCode)Called when a key is pressed.
The getGameAction() method can be called to determine what game action, if any, is mapped to the key. Class Canvas has an empty implementation of this method, and the subclass has to redefine it if it wants to listen this method.
Parameters:
keyCode - the key code of the key that was pressed
--------------------------------------------------------------------------------
keyRepeated
protected void keyRepeated(int keyCode)Called when a key is repeated (held down).
The getGameAction() method can be called to determine what game action, if any, is mapped to the key. Class Canvas has an empty implementation of this method, and the subclass has to redefine it if it wants to listen this method.
Parameters:
keyCode - the key code of the key that was repeated
See Also:
hasRepeatEvents()
--------------------------------------------------------------------------------
keyReleased
protected void keyReleased(int keyCode)Called when a key is released.
The getGameAction() method can be called to determine what game action, if any, is mapped to the key. Class Canvas has an empty implementation of this method, and the subclass has to redefine it if it wants to listen this method.
Parameters:
keyCode - the key code of the key that was released
--------------------------------------------------------------------------------
pointerPressed
protected void pointerPressed(int x,
int y)Called when the pointer is pressed.
The hasPointerEvents() method may be called to determine if the device supports pointer events. Class Canvas has an empty implementation of this method, and the subclass has to redefine it if it wants to listen this method.
Parameters:
x - the horizontal location where the pointer was pressed (relative to the Canvas)
y - the vertical location where the pointer was pressed (relative to the Canvas)
--------------------------------------------------------------------------------
pointerReleased
protected void pointerReleased(int x,
int y)Called when the pointer is released.
The hasPointerEvents() method may be called to determine if the device supports pointer events. Class Canvas has an empty implementation of this method, and the subclass has to redefine it if it wants to listen this method.
Parameters:
x - the horizontal location where the pointer was released (relative to the Canvas)
y - the vertical location where the pointer was released (relative to the Canvas)
--------------------------------------------------------------------------------
pointerDragged
protected void pointerDragged(int x,
int y)Called when the pointer is dragged.
The hasPointerMotionEvents() method may be called to determine if the device supports pointer events. Class Canvas has an empty implementation of this method, and the subclass has to redefine it if it wants to listen this method.
Parameters:
x - the horizontal location where the pointer was dragged (relative to the Canvas)
y - the vertical location where the pointer was dragged (relative to the Canvas)
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询