Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
41
gaia/dev_apps/uitest-privileged/js/API/keyevent_customization.js
Executable file
41
gaia/dev_apps/uitest-privileged/js/API/keyevent_customization.js
Executable file
|
|
@ -0,0 +1,41 @@
|
|||
'use stricts';
|
||||
|
||||
(function() {
|
||||
|
||||
function $(id) {
|
||||
return document.getElementById(id);
|
||||
}
|
||||
|
||||
var keyEventCustomization = {
|
||||
init: function ke_init() {
|
||||
window.addEventListener('keydown', this);
|
||||
window.addEventListener('keyup', this);
|
||||
},
|
||||
|
||||
handleEvent: function ke_handleEvent(e) {
|
||||
// We shows event information at received-event.
|
||||
$('received-event').textContent = e.key + ' ' + e.type;
|
||||
switch(e.key) {
|
||||
case 'VolumeDown':
|
||||
case 'VolumeUp':
|
||||
if ($('override-volume-keys').checked) {
|
||||
$('received-event').textContent += ' default prevented';
|
||||
// if override keys is checked, we should prevent default.
|
||||
e.preventDefault();
|
||||
}
|
||||
break;
|
||||
case 'Power':
|
||||
case 'Exit':
|
||||
case 'Home':
|
||||
if ($('override-power-exit-keys').checked) {
|
||||
$('received-event').textContent += ' default prevented';
|
||||
// if override keys is checked, we should prevent default.
|
||||
e.preventDefault();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
keyEventCustomization.init();
|
||||
})();
|
||||
Loading…
Reference in a new issue