summaryrefslogtreecommitdiff
path: root/utils.js
diff options
context:
space:
mode:
Diffstat (limited to 'utils.js')
-rw-r--r--utils.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/utils.js b/utils.js
index 9093a24..a22d0ae 100644
--- a/utils.js
+++ b/utils.js
@@ -100,6 +100,13 @@ function hexdump_buffer(a)
}
/*----------------------------------------------------------------------------
+** Convert arraybuffer to string
+**--------------------------------------------------------------------------*/
+function arraybuffer_to_str(buf) {
+ return String.fromCharCode.apply(null, new Uint16Array(buf));
+}
+
+/*----------------------------------------------------------------------------
** Converting keycodes to AT scancodes is very hard.
** luckly there are some resources on the web and in the Xorg driver that help
** us figure out what browser dependent keycodes match to what scancodes.