MK3100 two button press in Enterprise Browser

// Expert user has replied.
M Michael Viox 3 years ago
2 2 0

Hi!
OK so I have written this JScript (which doesn't work), but I am trying to capture the event of 2 buttons [UpArrow] && [escape] to be able to quite the app.
 

var KEY_SOFT1 = EB.KeyCapture.captureKey(true, 0x28);
var KEY_SOFT2 = EB.KeyCapture.captureKey(true, 0x26);
var KEY_SOFT3 = EB.KeyCapture.captureKey(true, 0x0D);
var KEY_SOFT4 = EB.KeyCapture.captureKey(true, 0x1B);
var map = {};
 
 
function doQuit()
{
        'use strict';
        var genObj = new ActiveXObject("PocketBrowser.Generic");
genObj.InvokemetaFunction('application', 'quit');
}
function doKeys(map{}){
onkeydown = onkeyup = function(e){
    e = e || event; // to deal with IE
    map[e.keyCode] = e.type == 'keydown';
    if(map{KEY_SOFT1} && map{KEY_SOFT4}){
        doQuit();
        map = {};
    }
}
}
 

 
 
Any suggestions would be very helpful!

Please register or login to post a reply

2 Replies

A Abhineet Agarwal

Dear Michael,

Try this out. I am hoping that Enterprise Browser Webkit Cab is being used in th device.
     //Callback function associated with key pressed events     function jsKeyEvent(keyData)    {       document.getElementById('myJsID').innerHTML = "Key Pressed:" + keyData;       if((keyData==38) ||(keyData==27))//38 is for Key Up & 27 is for ESC key      {          application.quit();      }    }        Key Pressed:
Let me know if you have any further queries.

Thanks & Regards,
Abhineet Agarwal
Enterprise Browser Software Lead

M Michael Viox

I'm not 100% sure on whether the correct names for the keys were spoken...

The front keys on the MK3100 are:
P1 - TRIG01 = "KeyCode"=dword:0026 ; UP
P2 - TRIG02 = "KeyCode"=dword:0028 ; DOWN
P3 - TRIG03 = "KeyCode"=dword:000D ; ENTER
P4 - TRIG04 = "KeyCode"=dword:001B ; ESCAPE

Right?  OK so I am trying to use these instead....
I pulled these from Function Buttons; Motion Sensor; Reset Button; External Ports - Motorola MK3100 Product Reference Manual [Page 18]

CONTACT
Can’t find what you’re looking for?