05-08-2018 06:04
05-08-2018 06:04
I've have an issue that stated yesterday afternoon (was working in the morning).
The upper left hardware button stopped working on both the simulator and when I run on a Versa.
I have several screens that use the hardware buttons and they are all having the same issue.
The code below runs at the start of the app and has the problem before anything else happens in the code.
I get the messages in the console for both 'down' and 'back' but not up. Also I don't get the "e.key:' + e.key" message when pressing "up", but I do for "down" and "back".
document.onkeypress = function(e) {
console.log('e.key: ' + e.key);
e.preventDefault();
switch (e.key) {
case "up":
console.log('main.up');
break;
case "down":
console.log('main.down');
break;
case "back":
console.log('main.back');
}
}
Answered! Go to the Best Answer.
05-09-2018 10:13 - edited 05-10-2018 08:54
05-09-2018 10:13 - edited 05-10-2018 08:54
I solved it.
I had a combo button on a screen that was invisible most of the time.
<use id="btnCourseDetails" href="#combo-button-upper-right" fill="fb-green" layer="0"> <set href="combo-button-icon" attributeName="href" to="graphics\course.png"/> <set href="combo-button-icon-press" attributeName="href" to="graphics\course.png"/> <set href="combo-button-stroke" attributeName="display" to="inline"/> </use>
I happened to have the screen up and pressed the hardware button and my combo button flashed.
So I changed the button to a combo-button-upper-left and the upper right hardware button started working every where in the app.
<use id="btnCourseDetails" href="#combo-button-upper-left" fill="fb-green" layer="0"> <set href="combo-button-icon" attributeName="href" to="graphics\course.png"/> <set href="combo-button-icon-press" attributeName="href" to="graphics\course.png"/> <set href="combo-button-stroke" attributeName="display" to="inline"/> </use>
So to sum up... The combo-button-upper-right (I'll assume lower-right as well) override any onkeypress binding setup in JavaScript.
05-09-2018 10:13 - edited 05-10-2018 08:54
05-09-2018 10:13 - edited 05-10-2018 08:54
I solved it.
I had a combo button on a screen that was invisible most of the time.
<use id="btnCourseDetails" href="#combo-button-upper-right" fill="fb-green" layer="0"> <set href="combo-button-icon" attributeName="href" to="graphics\course.png"/> <set href="combo-button-icon-press" attributeName="href" to="graphics\course.png"/> <set href="combo-button-stroke" attributeName="display" to="inline"/> </use>
I happened to have the screen up and pressed the hardware button and my combo button flashed.
So I changed the button to a combo-button-upper-left and the upper right hardware button started working every where in the app.
<use id="btnCourseDetails" href="#combo-button-upper-left" fill="fb-green" layer="0"> <set href="combo-button-icon" attributeName="href" to="graphics\course.png"/> <set href="combo-button-icon-press" attributeName="href" to="graphics\course.png"/> <set href="combo-button-stroke" attributeName="display" to="inline"/> </use>
So to sum up... The combo-button-upper-right (I'll assume lower-right as well) override any onkeypress binding setup in JavaScript.