コード例 #1
0
ファイル: KeyRepeater.cpp プロジェクト: opieproject/opie
void KeyRepeater::stop(int keycode)
{
	if(keycode == 0
		|| keycode == m_keycode
		|| isRepeatable(keycode) == false){
		m_pTimer->stop();
	}
}
コード例 #2
0
ファイル: UserInput.cpp プロジェクト: ElsonC/stonesense
void doRepeatActions()
{
    al_get_keyboard_state(&keyboard);
    int32_t keymod = getKeyMods(&keyboard);

    for(int keycode=0; keycode<ALLEGRO_KEY_UNKNOWN; keycode++) {
        if(isRepeatable(keycode) && al_key_down(&keyboard,keycode)) {
            doKey(keycode, keymod);
        }
    }
}
コード例 #3
0
ファイル: KeyRepeater.cpp プロジェクト: opieproject/opie
void KeyRepeater::start(int unicode, int keycode, int modifiers)
{
	m_unicode = unicode;
	m_keycode = keycode;
	m_modifiers = modifiers;
	if(m_mode == ENABLE){
		m_pTimer->stop();
		if(isRepeatable(keycode)){
			/* repeater start */
			m_pTimer->start(m_repeatdelay, TRUE);
		}
	}
}
コード例 #4
0
ファイル: UserInput.cpp プロジェクト: ElsonC/stonesense
void doKeys(int32_t key, uint32_t keymod)
{
    if(!isRepeatable(key)) {
        doKey(key,keymod);
    }
    return;

    //WAITING TO BE MOVED OVER
    //if(ssConfig.debug_mode) {
    //    if(Key == ALLEGRO_KEY_PAD_8) {
    //        ssConfig.follow_DFcursor = false;
    //        debugCursor.y--;
    //        paintboard();
    //    }
    //    if(Key == ALLEGRO_KEY_PAD_2) {
    //        ssConfig.follow_DFcursor = false;
    //        debugCursor.y++;
    //        paintboard();
    //    }
    //    if(Key == ALLEGRO_KEY_PAD_4) {
    //        ssConfig.follow_DFcursor = false;
    //        debugCursor.x--;
    //        paintboard();
    //    }
    //    if(Key == ALLEGRO_KEY_PAD_6) {
    //        ssConfig.follow_DFcursor = false;
    //        debugCursor.x++;
    //        paintboard();
    //    }

    //    if(Key == ALLEGRO_KEY_F10) {
    //        if(ssConfig.spriteIndexOverlay == false) {
    //            ssConfig.spriteIndexOverlay = true;
    //            ssConfig.currentSpriteOverlay = -1;
    //        } else {
    //            ssConfig.currentSpriteOverlay ++;
    //            if(ssConfig.currentSpriteOverlay >= IMGFilenames.size()) {
    //                ssConfig.currentSpriteOverlay = -1;
    //            }
    //        }
    //    }
    //    if(Key == ALLEGRO_KEY_SPACE) {
    //        if(ssConfig.spriteIndexOverlay == true) {
    //            ssConfig.spriteIndexOverlay = false;
    //        }
    //    }
    //}
}