• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Turning off shift after typing key

 
Joel Christophel
Ranch Hand
Posts: 250
1
Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Below is the code I'm using to add an OnKeyboardActionListener to my KeyboardView. (For the sake of brevity, I've omitted some required overridden methods that I've left empty.)



The problem

When I press the shift key, everything goes as expected; both the key's icon and the state of "shiftedness" changes.

However, when I press any other key (which is supposed to turn shift off), the state of shiftedness changes to off, but the icon doesn't change to the unshifted version.

I've tried calling postInvalidate() on my KeyboardView but to no avail.

Here's a video that highlights my problem.
 
Joel Christophel
Ranch Hand
Posts: 250
1
Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's my solution for any wondering. I added the following code to the end of the shiftOn method:

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic