Blocked repeated keyboard events from SDL
This commit is contained in:
@@ -126,6 +126,11 @@ static void execEvents() {
|
|||||||
|
|
||||||
//input
|
//input
|
||||||
case SDL_KEYDOWN: {
|
case SDL_KEYDOWN: {
|
||||||
|
//bugfix: ignore repeat messages
|
||||||
|
if (event.key.repeat) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
//determine the given keycode
|
//determine the given keycode
|
||||||
Literal keycodeLiteral = TO_INTEGER_LITERAL( (int)(event.key.keysym.sym) );
|
Literal keycodeLiteral = TO_INTEGER_LITERAL( (int)(event.key.keysym.sym) );
|
||||||
if (!existsLiteralDictionary(&engine.symKeyDownEvents, keycodeLiteral)) {
|
if (!existsLiteralDictionary(&engine.symKeyDownEvents, keycodeLiteral)) {
|
||||||
@@ -141,6 +146,11 @@ static void execEvents() {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_KEYUP: {
|
case SDL_KEYUP: {
|
||||||
|
//bugfix: ignore repeat messages
|
||||||
|
if (event.key.repeat) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
//determine the given keycode
|
//determine the given keycode
|
||||||
Literal keycodeLiteral = TO_INTEGER_LITERAL( (int)(event.key.keysym.sym) );
|
Literal keycodeLiteral = TO_INTEGER_LITERAL( (int)(event.key.keysym.sym) );
|
||||||
if (!existsLiteralDictionary(&engine.symKeyUpEvents, keycodeLiteral)) {
|
if (!existsLiteralDictionary(&engine.symKeyUpEvents, keycodeLiteral)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user