missing buttons? Firestick and maybe others.

Rob Hewitt

Member
Joined
Aug 30, 2017
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,
 

Rob Hewitt

Member
Joined
Aug 30, 2017
I should also say that I have the line

#ANDROID_GAMEPAD_ENABLED = True

at the top of my code also
 

Rob Hewitt

Member
Joined
Aug 30, 2017
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?
 

APC

New Member
Joined
Aug 8, 2017
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?
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:
Strict

Import mojo2

Class TestApp Extends App
    Field canvas:Canvas
    Field cw:Int, ch:Int
    Field char:Int, lastchar:Int, st:Int
    Field name:String
    Field txt1:String = "Press the keys on the keyboard"
    Field txt2:String = "Key code:"
    Field txt3:String = "Char:"

    Method OnCreate:Int()
        canvas = New Canvas()
        cw = DeviceWidth(); ch = DeviceHeight()
        SetUpdateRate(30)
        Return 0
    End
      Method OnUpdate:Int()

        ReadKeyboard()
        lastchar = char
        Return 0
    End
    Method OnRender:Int()
        canvas.Clear()
        canvas.SetColor(0.0, 1.0, 0.0)
        canvas.DrawText(txt1, cw * 0.5 - (txt1.Length() * 8) * 0.5, 100)
        canvas.SetColor(1.0, 1.0, 0.0)
        canvas.DrawText(txt2 + lastchar, cw * 0.5 - (txt2.Length() * 8) * 0.5, 200)
        canvas.SetColor(0.0, 1.0, 1.0)
        canvas.DrawText(txt3 + name, cw * 0.5 - (txt3.Length() * 8) * 0.5, 250)
        canvas.Flush()
        Return 0
    End
    Method ReadKeyboard:Int()
        If st = 0 Or MouseDown()
            st = EnableKeyboard()
        EndIf

'        Local idx:Int
       
        char = GetChar()
        If char = 0 Then char = lastchar
        name = String.FromChar(char)

'        If char = 13 'enter
'            DisableKeyboard()
'            st = 0
'        ElseIf char = 8 'back space
'            idx = name.Length()
'            name = name[0 .. idx - 1] 'remove last char
'        EndIf
        Return char
    End
End

Function Main:Int()
    New TestApp()
    Return 0
End
 

Rob Hewitt

Member
Joined
Aug 30, 2017
Thanks, I tried the above in Bluestacks and no keys worked. This could be Bluestacks of course.
 

Rob Hewitt

Member
Joined
Aug 30, 2017
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. :-(
 
Top Bottom