PicoMiteVGAUSB: What gamepads are supported ?
Author | Message | ||||
aFox Senior Member ![]() Joined: 28/02/2023 Location: GermanyPosts: 103 |
Hi You can get a button reference by OliBasic. Manual RFO-Basic 1.91: https://gitlab.com/OliBasic/Main/-/blob/master/OliBasicXXIV/Documentation/RFO-Basic%20Manual%201.91%20De_Re_BASIC!.pdf Fork of RFO-Basic 1.91 with a lot of enhancements, OliBasic 3.00+: OliBasic Inkey$ <svar>{{, <rawKeyEvent_svar>}, <utf-8_svar>} Reports key taps for the a-z, 0-9, Space and the D-Pad keys. The key value is returned in <svar>. The D-Pad keys are reported as "up", "down", "left", "right" and "go". If any key other than those have been tapped, the string "key nn" will be returned. Where nn will be the Android key code for that key. If no key has been tapped, the "@" character is returned in <svar>. Keep in mind, that soft keyboards send a limited character set. Characters like "°♤♡◇♧《》¡¿äöü" are only supported by USB or Bluetooth keyboards or other input devices like game pads in the case of this function. Rapid key taps are buffered in case they come faster than the BASIC! program can process. By rawKeyEvent you get an optional raw key event description with action, keyCode, scanCode, metaState, flags, repeatCount, eventTime, downTime, deviceId and source values. As an option you get with <utf-8_svar> the UTF-8 character back. If you want correct results use ONKEY…: interrupt handling instead a DO – UNTIL loop. But do not use the command PAUSE if have a lot keystrokes in conjunction with key event handling. Example KEYDOWN.ON % The opposite is KEYDOWN.OFF DO UNTIL 0 ONKEYDOWN: %A Key Is Down interrupt ! The second string, raw key event parameter INKEY$ mKey$, mKeyEvent$, mUniKeyEvent$ PRINT "Got "; mKey$, " "; mKeyEvent$, mUniKeyEvent$ KEYDOWN.RESUME %Resumes execution at the point BASIC! program where ! the OnKeyDown: interrupt occured. ONKEYPRESS: %Imo ONKEYUP points the fact better INKEY$ mKey$, mKeyEvent$, mUniKeyEvent$ PRINT "Got "; mKey$, " "; mKeyEvent$, mUniKeyEvent$ KEY.RESUME Maybe you are also interested in: Device.USB <bundlePointer_nvar> Returns the parameters of plugged in USB devices. Following keys are supported "_DeviceId", "_VendorId", "_ProductId", "_DeviceClass", "_InterfaceClass0", "_DeviceSubclassId", "_DeviceName", "_SerialNumber", "_ManufacturerName", "_ProductName", "_UsbInterface", "_Driver" and "_AllAsString". The keys "_SerialNumber", "_ManufacturerName" and "_ProductName" are available on Android 5+. Starting on Android 10+ a permission has to be granted for each USB device. Is a dialog canceled or after five seconds not confirmed the property enumeration is skipped. Example: DEVICE.USB bp BUNDLE.KEYS bp, lp LIST.SIZE lp, n FOR i = 1 TO n BUNDLE.GB bp, int$(i), pUSB BUNDLE.GET pUSB, "_AllAsString", aAS$ PRINT aAS$ NEXT See also USB command group Try to plug in your Pico boards or other µC boards and compare. Android on Raspberry Pi Gregor Edited 2025-02-06 11:40 by aFox |
||||