USB Game Controllers?

Creating Games? Developing something for fun?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
richardmac
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 211
Joined: Sun Oct 24, 2010 12:13 am

USB Game Controllers?

Post by richardmac » Mon May 14, 2018 12:39 am

Work goes very well on my proof of concept Galaga-type game. Basically I have everything working, including randomized attack patterns for my 8 baddies. I'm super happy with the results so far!

So my next thought was to try to get my game working with my usb game controller. It's an older controller, made by Game Elements, and it has a lot of buttons and USB. It works great with OpenEmu on my Mac (OS 10.13.) Searching through the forums here and also Google, basically the advice was to use rawKeyDown to trap for the buttons on the controller. Nothing registers. Nothing. I downloaded some old stacks like "PADDER" but they all used rawKeyDown. Doesn't work.

Sooooo anyone got any thoughts on this? I read there used to be some type of plugin that probably no longer works. I'm wondering about appleEvents, maybe? Any thoughts?

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9249
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: USB Game Controllers?

Post by richmond62 » Thu May 31, 2018 8:19 pm

Nothing registers. Nothing.
That is very queer indeed.

Here's a thought: open a text document in a text editor of your choice and
see if you get anything when pressing keys on your gamepad.

If you don't, the problem may lie with your gamepad.

I use a Nostromo Array (super-glued to a woman's hairband so that it sits still on my left thigh)
with Linux and Macintosh for repetitive guff with LiveCode, and it is "horribly" out-dated.
NG.jpg
Of course, the Nostromo series of gamepads had their own series of driver stuff:
NG2.png
I haven't tried it with OpenEMU for the plain and simple reason that its own stuff "cuts the mustard": see if you cannot find original Mac drivers for your gamepad: this may make all the difference.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9249
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: USB Game Controllers?

Post by richmond62 » Thu May 31, 2018 8:51 pm

In theory (!) any USB device with buttons sends rawKeyDown and rawKeyUp
signals to a computer it is connected to.

However, this is not as easy as it seems, as operating systems tend not to know what to do
with those signals unless there is some sort of driver/interpreter between them and LiveCode.

richardmac
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 211
Joined: Sun Oct 24, 2010 12:13 am

Re: USB Game Controllers?

Post by richardmac » Tue Jun 05, 2018 11:51 pm

I connected the USB controller to a text editor, and nothing. So I think you're right - the OS doesn't know what to do with the input. OpenEmu likely has some generic USB game pad drivers in it, so it works well with that.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9249
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: USB Game Controllers?

Post by richmond62 » Wed Jun 06, 2018 7:41 am

Out of interest, what is the make and model of your gamepad?

richardmac
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 211
Joined: Sun Oct 24, 2010 12:13 am

Re: USB Game Controllers?

Post by richardmac » Thu Jun 14, 2018 12:10 pm

Oops! Sorry it took me so long to respond.

It's the iBuffalo Classic USB Gamepad. I use it with OpenEmu, which lets you run old arcade games in emulation. It also runs NES, SNES, and a ton of other systems.

Aha! OK, yeah, I think I figured this out. The iBuffalo Classic USB Gamepad says nothing on the box about working on a Mac. It only says PC. It works fine with OpenEmu, but... perhaps that means OpenEmu has drivers for it? Yeah, that has to be it. OK, so I can download and install USB Overdrive and see if that works. It might. I just sort of assumed that these things were generic USB devices and the Mac would recognize it. But probably not.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9249
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: USB Game Controllers?

Post by richmond62 » Thu Jun 14, 2018 12:25 pm

I just sort of assumed that these things were generic USB devices and the Mac would recognize
them.

I have fallen foul of that assumption all over the place.

Presumably what the manufacturer means (incorrectly) by "PC" (err, "Personal Computer") is a machine running a version of Microsoft Windows.

The most forgiving system re USB devices, in my experience, is Linux: but I have got myself in trouble there once or twice.

----------------

https://github.com/OpenEmu/OpenEmu/issues/1966

https://github.com/OpenEmu/OpenEmu/issues/3448

speedbump1981
Posts: 14
Joined: Fri Aug 08, 2014 7:24 am

Re: USB Game Controllers?

Post by speedbump1981 » Sun Jul 22, 2018 5:40 am

I tested a usb gamepad external that worked wonderfully well. Get in contact with Thierry Douez for the latest copy. I don't believe I have permission to distribute it, but I need to locate it first. :)
Derek Bump | Oshkosh, WI

Dreamscape Software (Closed)
JPEGCompress, "Side-scrolling Game Test"

Factory Direct Shippers, LLC (Retired)
Online Shopping Cart & Customer Information Manager

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9249
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: USB Game Controllers?

Post by richmond62 » Sun Jul 22, 2018 5:03 pm


Post Reply

Return to “Games”