GameController

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
thebelg
Posts: 24
Joined: Thu Nov 01, 2012 8:51 pm
Location: Germany

GameController

Post by thebelg » Wed Mar 16, 2016 4:40 pm

For an application we/I need to use a Gamecontroller :cry: instead of Keyboard.
Can anyone give me an example-code or a tip to get the data from the Controller.
The Controller will be connected via bluetooth
Regards

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm
Location: McKenna, WA

Re: GameController

Post by quailcreek » Wed Mar 16, 2016 6:36 pm

If you have an Indy license look at the mergBLE external.
Tom
MacBook Pro OS Mojave 10.14

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

Re: GameController

Post by richmond62 » Wed Mar 16, 2016 7:41 pm

That depends very much on your operating system and your non-keyboard controller.

For instance, I have a Belkin Nostromo which sends keyboard letters (from the left side of the keyboard) on Linux,
and as a result I can simply use "keyDown" and "keyUp" statements for a game controlled by a Nostromo.

Open a text editor, connect your game pad, and see what comes up in your text editor when you press each
button on your game pad . . . .
Last edited by richmond62 on Tue Mar 15, 2022 9:08 am, edited 1 time in total.

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

Re: GameController

Post by richmond62 » Wed Mar 16, 2016 8:06 pm

PadOmatic.png
Attachments
PADDER.zip
Here's the stack.
(50.32 KiB) Downloaded 559 times

thebelg
Posts: 24
Joined: Thu Nov 01, 2012 8:51 pm
Location: Germany

Re: GameController

Post by thebelg » Thu Mar 17, 2016 1:33 pm

Thanks. I solved the problem (on Windows) with "JoyToKey" (http://joytokey.net/en/")
regards

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

Re: GameController

Post by richmond62 » Tue Jul 05, 2016 8:08 am

It's that time again: when Richmond bangs on about his Nostromo gamepad.

Well, I was getting cheesed-off as the drivers for the Belkin Nostomo gamepads written
for Linux just don't cut the mustard.

So I knocked up a silly little stack to use as a way of teaching kids about the rawKeyDown thing
and Switch-Case routines.

Once one knows what rawKey signals are sent by a gamepad one can leverage the thing for one's stacks/standalones.

The good thing about Linux is that is detects an external USB gamepad without a driver or configure app, so one can
use it directly. Whether the same can be said for Macintosh or Windows I don't know. Certainly the Nostromo gamepads
are about 8 years out of date so the drivers Belkin do supply for Mac/Win are not up to speed re current versions
of those operating systems: http://www.belkin.com/us/support-articl ... leNum=4923
Nost.jpg
Attachments
gamepad Example.livecode.zip
(60.33 KiB) Downloaded 288 times

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

Re: GameController

Post by richmond62 » Mon Jul 11, 2016 3:40 pm

antimicro seems to recognise all USB input devices on Linux and
allow you to configure the, the only snag is that you have to have antimicro
running for those configurations to be piped through to Livecode.

http://www.webupd8.org/2014/09/gamepad- ... g-app.html

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

Re: GameController

Post by richmond62 » Wed Sep 11, 2019 9:15 pm

My beloved Nostromo pads were not playing nicely with MacOS 10.14.6
-
t9-pro.jpg
-
Just got a T9 Pro to do what I want on a MacMini by remapping the CTRL key on it to "do" the CMD key for Mac:
-
Screenshot 2019-09-11 at 23.11.19.png
-
and mucking around with the 'b" key on the T9 so it becomes a "c" key (for copying) using Karabiner-Elements:

https://pqrs.org/osx/karabiner/

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

Re: GameController

Post by richmond62 » Tue Mar 15, 2022 9:21 am

Wow . . . here I go again, again, again . . .

As my Belkin Nostromo n52 sends these key signals into both Mac and Linux boxes, and they can be readily picked
up by LiveCode . . .
-
NC.png
-
Is there a way one could write a macro-thing [of course a plug-in for LC is comparatively easy, although
ANY 'q' key, regardless of where it came from would be over-written] that could send signals outwith LC
to other applications (just as the Belkin system extensions did for MacOS 9 to MacOS 10).

The four-way rocker switch can send arrowKey signals.

I currently use my Nostromo gamepads (n50 and n52) with Linux boxes using antimicro.

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”