View Full Version : Extended soft key problem

09-25-2007, 08:57 AM
I am trying to override the functionality of left and right soft key of Windows mobile O2 device. I have written the code as

fscommand2("SetSoftKeys", "Left", "Right");
fscommand2("FullScreen", true);
Key.removeListener (myListener);

var myListener:Object = new Object ();
myListener.onKeyDown = function () {
var keyCode = Key.getCode ();
if (keyCode == ExtendedKey.SOFT1) {
Status = "Left soft key pressed";
if (keyCode == ExtendedKey.SOFT2) {
Status = "Right soft key pressed";

Key.addListener (myListener);

It is working perfectly on the emulator but when I test it on the device and press the right soft key. The application is exiting.
Is there any other way for it.

10-03-2007, 02:52 PM
Amisha, your code looks correct at a quick glance. I'm at work so can't check but it *looks* exactly like code I use (unless there's a small typographical error I'm missing). The response you're getting sounds like it's not supported. One thing you can do is change your code to:

isSupported = fscommand2("SetSoftKeys", "Left", "Right");

And then do a trace on isSupported. Per the docs it should return a 0 if the device supports that command, -1 if not. My device that it works on is WM5 , not 02 also.