Use pressed classname for pressed keys.
authorMichael Jumper <zhangmaike@users.sourceforge.net>
Mon, 23 Jan 2012 18:04:27 +0000 (10:04 -0800)
committerMichael Jumper <zhangmaike@users.sourceforge.net>
Mon, 23 Jan 2012 18:04:27 +0000 (10:04 -0800)
src/main/resources/oskeyboard.js

index 2c095fb..5d3fa02 100644 (file)
@@ -241,7 +241,10 @@ Guacamole.OnScreenKeyboard = function(url) {
                     row.appendChild(key_container_element);
 
                     // Set up click handler for key
-                    key_element.onclick = function() {
+                    key_element.onmousedown  =
+                    key_element.ontouchstart = function() {
+
+                        key_element.classList.add("guac-keyboard-pressed");
 
                         // Get current cap based on modifier state
                         var cap = key.getCap(on_screen_keyboard.modifiers);
@@ -270,6 +273,11 @@ Guacamole.OnScreenKeyboard = function(url) {
 
                     };
 
+                    key_element.onmouseup  =
+                    key_element.ontouchend = function() {
+                        key_element.classList.remove("guac-keyboard-pressed");
+                    };
+
                 }
                 
             });