mirror of
https://github.com/apache/cordova-android.git
synced 2026-04-23 00:00:09 +08:00
Merged code for bryfox: Re-add support for search & menu key triggers.
See original commit: https://github.com/bryfox/phonegap-android/commit/799515fa7b8b5ccc94487e519f520929104ade2c
This commit is contained in:
@@ -6,25 +6,27 @@
|
||||
* Copyright (c) 2010, IBM Corporation
|
||||
*/
|
||||
|
||||
function KeyEvent()
|
||||
{
|
||||
function KeyEvent() {
|
||||
}
|
||||
|
||||
KeyEvent.prototype.backTrigger = function()
|
||||
{
|
||||
var e = document.createEvent('Events');
|
||||
e.initEvent('backKeyDown');
|
||||
document.dispatchEvent(e);
|
||||
}
|
||||
KeyEvent.prototype.backTrigger = function() {
|
||||
var e = document.createEvent('Events');
|
||||
e.initEvent('backKeyDown');
|
||||
document.dispatchEvent(e);
|
||||
};
|
||||
|
||||
KeyEvent.prototype.menuTrigger = function()
|
||||
{
|
||||
var e = document.createEvent('Events');
|
||||
e.initEvent('menuKeyDown');
|
||||
document.dispatchEvent(e);
|
||||
}
|
||||
KeyEvent.prototype.menuTrigger = function() {
|
||||
var e = document.createEvent('Events');
|
||||
e.initEvent('menuKeyDown');
|
||||
document.dispatchEvent(e);
|
||||
};
|
||||
|
||||
if (document.keyEvent == null || typeof document.keyEvent == 'undefined')
|
||||
{
|
||||
window.keyEvent = document.keyEvent = new KeyEvent();
|
||||
KeyEvent.prototype.searchTrigger = function() {
|
||||
var e = document.createEvent('Events');
|
||||
e.initEvent('searchKeyDown');
|
||||
document.dispatchEvent(e);
|
||||
};
|
||||
|
||||
if (document.keyEvent == null || typeof document.keyEvent == 'undefined') {
|
||||
window.keyEvent = document.keyEvent = new KeyEvent();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user