Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Workaround for report of "key events not trickling up" on Digium IP Phone API forum http://forums.digium.com/viewtopic.php?f=49&t=86142&sid=9b5d1727b604485f74752bf9d0364055
diff --git a/test/test.js b/test/test.js
index df4a40e..4830152 100644
--- a/test/test.js
+++ b/test/test.js
@@ -3,8 +3,6 @@ app.init();
var screen = require('screen');
-var genericMenu = require('genericMenu');
-
var index = 0;
var max_index = 0;
@@ -130,36 +128,27 @@ handler.processMenuAction = function (params) {
break;
}
};
-//the softkeys are defined in an array
-var softkeys = [
- {
- 'label' : 'Next',
- 'actionId' : 'next',
- 'icon' : app.images.softKeys.left
- },
- {
- 'label' : 'Prev',
- 'actionId' : 'prev',
- 'icon' : app.images.softKeys.right
- },
- {
- 'label' : '',
- 'actionId' : ''
- },
- {
- 'label' : 'Cancel',
- 'actionId' : 'exit',
- 'icon' : app.images.softKeys.cancel
- }
-];
-//show the menu
-genericMenu.show({
- 'id' : 'test',
- 'menu' : new Array(),
- 'object' : handler,
- 'title' : '',
- 'softkeys' : softkeys
-});
+
+window.setSoftkeysByList([
+ {
+ 'label' : 'Next',
+ 'handler' : nextVerse,
+ 'icon' : app.images.softKeys.left
+ },
+ {
+ 'label' : 'Prev',
+ 'handler' : prevVerse,
+ 'icon' : app.images.softKeys.right
+ },
+ {
+ 'label' : '',
+ },
+ {
+ 'label' : 'Cancel',
+ 'handler' : digium.background,
+ 'icon' : app.images.softKeys.cancel
+ }
+]);
function go(win, visiblePredicate) {
// don't update widgets when we're in the background.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.