I am trying to build an app, and I am on the latest SDK. I'm trying to access the key controls with KeyEvent (and not just the onSelect behavior because I would like to use the onTap and onSwipe as well) but I get this error below. I have tried already many options, including using the InputDelegate instead but I cannot get it work appropriate.
If I store keyEvent.getKey() in a variable first, it doesn't throw an error at that step. But printing that variable - logically - still gives me the same error. Also, for example, printing the keyEvent.getKey() == 1 only return false (for a range of numbers). As I am new, I would like to print the values so I know what I am dealing with.
Below a sample of the code (which is directly from the API docs), is there anyone who knows how to get this part of the code going?
Thank you!