Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 01:07 08 Feb 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : PicoMiteVGAUSB: What gamepads are supported ?

     Page 2 of 2    
Author Message
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4136
Posted: 10:02am 05 Feb 2025
Copy link to clipboard 
Print this post

  Mixtel90 said  Looks up the Buffalo pad on Amazon:

"Currently unavailable.
We don't know when or if this item will be back in stock."


It doesn't really matter, https://github.com/mdqinc/SDL_GameControllerDB/blob/master/gamecontrollerdb.txt contains SDL2 mappings for over 800 controllers ... there is no generic controller (my bad) ... for this to work either PicoMiteUSB has to have a similar mapping system or we are back to custom built controllers (great hobby project, lousy ergonomics) or someone has to buy a lot of the same controller, persuade Peter to support it and then re-sell it as the "standard" controller.

Best wishes,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
javavi

Guru

Joined: 01/10/2023
Location: Ukraine
Posts: 366
Posted: 11:22am 05 Feb 2025
Copy link to clipboard 
Print this post

Perhaps this library can help in this case with USB joysticks.

pico-hid-host
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7106
Posted: 11:25am 05 Feb 2025
Copy link to clipboard 
Print this post

The ergonomics don't have to be completely lousy. It depends on getting enough buttons/pads/whatever 3d printed or injection moulded. A reasonably acceptable "enclosure" for the hobbyist (not the serious gamer) can be two pieces of plastic/PCB with spacers and the control PCB sandwiched between them (or something along those lines). The thing is, you can't use an enclosure from even look-alike controllers as they differ internally and the cost of having "proper" enclosures made is prohibitive.

The actual controller electronics can be whatever we like. We control that. That's the (relatively) easy bit. :)  Just find a way to use the USB port on a RP2040-Zero to send data to the USB input on a bigger box. I've sent codes representing key presses using Circuit Python so something must be possible. In that case it just appears as a keyboard device. I would suggest that this *is* a generic controller. :) It sends W,A,S,D,Q,E etc. and can be programmable to work on any nationality of keyboard layout.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
aFox
Regular Member

Joined: 28/02/2023
Location: Germany
Posts: 97
Posted: 01:13am 06 Feb 2025
Copy link to clipboard 
Print this post

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
 
     Page 2 of 2    
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2025