Tiny Thor (made with Monkey X)
Develop on Windows or OSX and deploy easily
Crypt of the Necrodancer (made with Monkey X)
New Star Soccer - BAFTA Winner 2013!!! (made with Monkey X )
Ted - The code editor of Cerberus X
Avalon Legends (made with Monkey X)
Race Time (made with Monkey X)

missing buttons? Firestick and maybe others.

Rob Hewitt Oct 17, 2017

  1. Rob Hewitt

    Rob Hewitt Member

    Messages:
    77
    Likes Received:
    40
    Trophy Points:
    18
    Hi,

    I have searched all 512 Keydown flags and also tried all combinations of JoyDown via a Mak's JoyTest program but I can't seem to find the fire buttons.

    On my Amazon Firestick the remote only registers the 4 directions. Select, Back, Home, Menu, Rewind, Forward and Play all don't register.

    When I try a bluetooth gamepad, the analogue directions worked but no other button registered.

    if it's not in there is there a way of reading them at all?

    Cheers,
     
  2. Rob Hewitt

    Rob Hewitt Member

    Messages:
    77
    Likes Received:
    40
    Trophy Points:
    18
    I should also say that I have the line

    #ANDROID_GAMEPAD_ENABLED = True

    at the top of my code also
     
  3. Rob Hewitt

    Rob Hewitt Member

    Messages:
    77
    Likes Received:
    40
    Trophy Points:
    18
    the input handling in Cerberus under Android definitely needs looking at at some point. Bluestacks (which I know isn't a real Android device but other software doesn't have problems on it) only reports cursor keys from a whole keyboard.

    Does anyone know of a java (or C) library that can be used to capture input (keys/joypad/sensors) outside of Cerberus' ways?
     
  4. MikeHart

    MikeHart Administrator Staff Member Administrator Moderator

    Messages:
    1,237
    Likes Received:
    300
    Trophy Points:
    83
    It definitely needs enhancement.
     
    Rob Hewitt likes this.
  5. APC

    APC New Member

    Messages:
    12
    Likes Received:
    2
    Trophy Points:
    3
    Hello Rob, Below is the code I use to read keyboard events, it works on Android, iOS, Windows and Mac Console (GLFW3) and HTML5. It picks up keyboard codes like, Home, End, PageUp, Del, etc.
    Give it a try and you may get the key code you are looking for, just copy the code below, paste it in Cerberus, save it and run.


    Code (Cerberus X):
    1.  
    2. Strict
    3.  
    4. Import mojo2
    5.  
    6. Class TestApp Extends App
    7.     Field canvas:Canvas
    8.     Field cw:Int, ch:Int
    9.     Field char:Int, lastchar:Int, st:Int
    10.     Field name:String
    11.     Field txt1:String = "Press the keys on the keyboard"
    12.     Field txt2:String = "Key code:"
    13.     Field txt3:String = "Char:"
    14.  
    15.     Method OnCreate:Int()
    16.         canvas = New Canvas()
    17.         cw = DeviceWidth(); ch = DeviceHeight()
    18.         SetUpdateRate(30)
    19.         Return 0
    20.     End
    21.       Method OnUpdate:Int()
    22.  
    23.         ReadKeyboard()
    24.         lastchar = char
    25.         Return 0
    26.     End
    27.     Method OnRender:Int()
    28.         canvas.Clear()
    29.         canvas.SetColor(0.0, 1.0, 0.0)
    30.         canvas.DrawText(txt1, cw * 0.5 - (txt1.Length() * 8) * 0.5, 100)
    31.         canvas.SetColor(1.0, 1.0, 0.0)
    32.         canvas.DrawText(txt2 + lastchar, cw * 0.5 - (txt2.Length() * 8) * 0.5, 200)
    33.         canvas.SetColor(0.0, 1.0, 1.0)
    34.         canvas.DrawText(txt3 + name, cw * 0.5 - (txt3.Length() * 8) * 0.5, 250)
    35.         canvas.Flush()
    36.         Return 0
    37.     End
    38.     Method ReadKeyboard:Int()
    39.         If st = 0 Or MouseDown()
    40.             st = EnableKeyboard()
    41.         EndIf
    42.  
    43. '        Local idx:Int
    44.        
    45.         char = GetChar()
    46.         If char = 0 Then char = lastchar
    47.         name = String.FromChar(char)
    48.  
    49. '        If char = 13 'enter
    50. '            DisableKeyboard()
    51. '            st = 0
    52. '        ElseIf char = 8 'back space
    53. '            idx = name.Length()
    54. '            name = name[0 .. idx - 1] 'remove last char
    55. '        EndIf
    56.         Return char
    57.     End
    58. End
    59.  
    60. Function Main:Int()
    61.     New TestApp()
    62.     Return 0
    63. End
    64.  
     
    MikeHart likes this.
  6. Rob Hewitt

    Rob Hewitt Member

    Messages:
    77
    Likes Received:
    40
    Trophy Points:
    18
    Thanks, I tried the above in Bluestacks and no keys worked. This could be Bluestacks of course.
     
  7. Rob Hewitt

    Rob Hewitt Member

    Messages:
    77
    Likes Received:
    40
    Trophy Points:
    18
    Drat. Upgraded my phone from an s6 to an s9 and now my bluetooth pad (same one that was fine before) no longer works in my games in the app store. And yet still works fine in the other apps and games that it worked on on the s6. :-(