forked from mozilla-b2g/gaia
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdesktop.js
More file actions
19 lines (17 loc) · 689 Bytes
/
Copy pathdesktop.js
File metadata and controls
19 lines (17 loc) · 689 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- /
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
'use strict';
function OnLoad() {
var contentFrame = document.getElementById("contentFrame");
var contentWindow = contentFrame.contentWindow;
var buttons = document.querySelectorAll("button");
for (var n = 0; n < buttons.length; ++n) {
var button = buttons[n];
button.ontouchstart = button.onmousedown = function() {
contentWindow.postMessage("moz-key-down-" + button.id, "*");
}
button.ontouchend = button.onmouseup = function() {
contentWindow.postMessage("moz-key-up-" + button.id, "*");
}
}
}