summaryrefslogtreecommitdiff
path: root/platform/javascript/javascript_main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'platform/javascript/javascript_main.cpp')
-rw-r--r--platform/javascript/javascript_main.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/platform/javascript/javascript_main.cpp b/platform/javascript/javascript_main.cpp
index e66110b655..632ef2b6b2 100644
--- a/platform/javascript/javascript_main.cpp
+++ b/platform/javascript/javascript_main.cpp
@@ -74,6 +74,15 @@ static void _glut_skey(bool pressed,int key) {
case GLUT_KEY_INSERT: ev.key.scancode=KEY_INSERT; break;
}
+ if (pressed) {
+ if (os->skey_pressed[key])
+ ev.key.echo = true;
+ else
+ os->skey_pressed[key] = true;
+ }
+ else {
+ os->skey_pressed[key] = false;
+ }
uint32_t m = glutGetModifiers();
ev.key.mod.alt=(m&GLUT_ACTIVE_ALT)!=0;
@@ -107,6 +116,16 @@ static void _glut_key(bool pressed,unsigned char key) {
default: {
ev.key.unicode=key;
}
+
+ if (pressed) {
+ if (os->key_pressed[key])
+ ev.key.echo = true;
+ else
+ os->key_pressed[key] = true;
+ }
+ else {
+ os->key_pressed[key] = false;
+ }
}