?? keyrepeat.java
字號:
/* * KeyRepeat.java * * Created on 2003年4月29日, 下午9:40 */package handenglish; import javax.microedition.midlet.*;/** * * @author sanmulong * @version */public class KeyRepeat extends Thread{ private boolean m_cancel = false; private long m_sleepTime =100; private int m_gameAction = 0; private final KeyRepeator m_ui; public KeyRepeat( KeyRepeator ui ) { m_ui = ui; } public void cancel() { m_cancel = true; } public int getGameAction() { return m_gameAction; } public void setSleepPeriod( long sleepTime ) { m_sleepTime = sleepTime; } public void startRepeat( int gameAction ) { m_gameAction = gameAction; } public void stopRepeat( int gameAction ) { if ( gameAction == m_gameAction ) m_gameAction = 0; } public void run() { while ( !m_cancel ) { while ( m_gameAction == 0 && !m_cancel ) Thread.yield(); m_ui.movePressed( m_gameAction ); try { sleep( m_sleepTime ); } catch( Exception e ){} } }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -