Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Top left hardware button not working.

ANSWERED

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');
 }
}

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

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.

 

View best answer in original post

Best Answer
0 Votes
1 REPLY 1

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.

 

Best Answer
0 Votes