⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 keyrepeat.java

📁 英语背单词联网版本
💻 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 + -