onkey down

 I am starting to understand onKeyDown(int keyCode, KeyEvent event)  The problem is calling this function.

keycode: I think is OuyaController.BUTTON_O  for example.

how do i set the keyevent?

Comments

  • BuddyBuddy Posts: 183Member
    What are you trying to do?  Generally onKeyDown events are called automatically for you by the operating system...  
  • guillaumesoftguillaumesoft Posts: 50Member
    Well that explain a lot.  I am new with android and newer with ouya but my experiences is with XNA and C# If its called automatically why do we have to have onkey funtion in the tutorials.
  • mjoynermjoyner Posts: 168Member
    edited August 2013
    You are creating an onkey function to RESPOND to what the OS sends you.

    It is a HANDLER.
    Post edited by mjoyner on
  • guillaumesoftguillaumesoft Posts: 50Member
    Okay, I got it.  thank you.
  • guillaumesoftguillaumesoft Posts: 50Member
    I am starting to make some headway.  I want to call the onkeydown() function.  I want to know if the user pressed the O button. c.onKeyDown(OuyaController.BUTTON_O, event);  What goes in the event parameter?  I also want to check if the left joystick is moving up or down.
  • guillaumesoftguillaumesoft Posts: 50Member
    I forgot to say please, please.
  • guillaumesoftguillaumesoft Posts: 50Member
    I am making some progress.  I am using opengl and when the game starts I initialize the controller then add the event functions.  The event function send the status of each button,l thumbstick to input class.
    the class is static and is always updated  with a  controller event.  I can not seem to do it any other way.
Sign In or Register to comment.