Take the 2-minute tour ×
Arqade is a question and answer site for passionate videogamers on all platforms. It's 100% free, no registration required.

I'm not sure how it happens, but when I'm scrolling around the screen with the arrow keys, occasionally, the screen will start scrolling in one direction, even without me pressing the keys. It's like the keys are stuck on. This only happens in Company of Heroes and nowhere else.

If I press the arrow that matches the direction the screen is scrolling in, this phenomenon stops.

Can anyone help me get this to stop?

share|improve this question
    
I am afraid that this is a common issue in more top-down games than just Company of Heroes. (League of Legends for instance) The only solution I've ever found was to do exactly as you described; pressing the matching directional keys. It isn't too bad, and you already know how to fix it! This issue actually occurs in many games on occasion, some FPS' as well! –  Lemmings19 Feb 17 '12 at 2:56

1 Answer 1

This means that the event for release arrow up never got registered.

Most times this is implemented as

void onkeydown(KeyBoardEvent e){
    if(e.getKey()==K_ARROW_UP){
        startScroll(up);
    }else if(e.getKey()==K_ARROW_DOWN){
        startScroll(down);
    }
}

void onkeyup(KeyBoardEvent e){
    if(e.getKey()==K_ARROW_UP){
        stopScroll();
    }else if(e.getKey()==K_ARROW_DOWN){
        stopScroll();
    }
}

where startScroll() can be (incidentally) called multiple times without issue, or stopscroll() will stop all scrolling, or there is a threading issue.

share|improve this answer
1  
I dont see how this is an answer this is simply just an explanation of why it happens but no info on how you could possibly prevent it. –  Serge Bekenkamp Feb 15 '12 at 0:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.