keyDown, keyUp, headBang

Organizing tasks to work on, New Features Ideas, Building LCS & LCB Libraries & Widgets, Redecorating and Modifying the IDE, Hacking / Editing Tools, Compiling the Engine from Source, etc.
User avatar
OpenXTalkPaul
Posts: 1871
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: keyDown, keyUp, headBang

Post by OpenXTalkPaul »

Also 'Plug-and-Play' really just means that it's a class compliant device, doesn't it? Such as device can be used with generic class driver built into the OS. Many Game Controllers, adapters and a lot of MIDI to USB adapter/cables are like that as well.
User avatar
OpenXTalkPaul
Posts: 1871
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: keyDown, keyUp, headBang

Post by OpenXTalkPaul »

I think I'm going to test it out on Linux (since I only extensively tested on Mac & Windows) and add it to OXT DPE. It's a small library and I think it could be a feature that appeals to other tinkerers.
User avatar
richmond62
Posts: 3264
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: keyDown, keyUp, headBang

Post by richmond62 »

Let me try to explain EXACTLY what my 'problem' is (no, not that problem, nor that problem, nor that one either :D ), with regard to peripheral devices.

I shall use as an example my Genesis Thor 100 rgb (which is, as someone remarked, a bit outdated: so, hell, am I, and I picked it up very cheaply indeed because I did NOT want the latest 'thang' to play games with, but a 'thing on the left' to stop wrist cramp) as it is the peripheral that happens to be connected to the computer I am sitting in front of at the moment.

So:

1. If I hit the 'Q' button on the gamepad I get a 'q' sent to my OXT stack.

2. If I hit the 'Q' button on my keyboard I get a 'q' sent to my OXT stack.

No prizes for that one!

HOWEVER, what I wonder about is whether there could be a way inwith the OXT IDE to work out whether that 'q' signal was originating in the gamepad or the keyboard.

IF there were a way to detect where the 'q' originated one could set up a series of "macro" commands/functions in a stack so that Chummy playing the game one has authored in one's stack could, for the sake of argument, control the movement of the "zombies" with the gamepad, while using the matching keys on the keyboard for something quite different.

Many gamepads come with software to set up macros (my Belkin Nostromo n30 and n50 cam with this software for Macintosh 32-bit), but they tend to be confined to one or two operating systems (my Genesis Thor 100 has a set up thing for Windows 8 only): and an end-user will not necessarily set their device's macros up the way the programmer of the OXT game wants.
https://richmondmathewson.owlstown.net/
User avatar
OpenXTalkPaul
Posts: 1871
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: keyDown, keyUp, headBang

Post by OpenXTalkPaul »

richmond62 wrote: Wed Mar 20, 2024 4:02 pm HOWEVER, what I wonder about is whether there could be a way inwith the OXT IDE to work out whether that 'q' signal was originating in the gamepad or the keyboard.
IF that Genesis Thor 100 thing is an HID class device, then it should show up in the Demo stack when it gets the HID device list, you then use the device ID/name of device from that list to poll the desired device, and then you should be able to use the library to isolate it's signals and to be able to respond to its signals (to trigger macros or send MIDI data or whatever you want) separately from your main keyboard's signals.
Other than that I don't think there's another way to do it for non-class compliant devices, and you'll need the driver for that device (that could be why it was so cheap ;-) ) There could be some other method that I don't know about, like polling some IO pipes or Mach Port with the operating system.

I had to give up an excellent M-Audio sound / MIDI card for the same lack of continued support reason, I should have kept that for my classic rig. I did find an Free OpenSource replacement driver for my 20+ year old 2x2 MIDI to USB adapter though!
User avatar
richmond62
Posts: 3264
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: keyDown, keyUp, headBang

Post by richmond62 »

The Thor thing was so cheap because here in Bulgaria the type of people who play computer games are desperate to be the leaders of fashion: and I found the Thor thing "somewhere smelly round the back" of the store (i.e. on a shelf labelled 'old stock').

https://youtu.be/nxTnJPIl20U

Whoops:
-
Screenshot 2024-03-20 at 18.31.42.png
Screenshot 2024-03-20 at 18.31.42.png (25.11 KiB) Viewed 2244 times
https://richmondmathewson.owlstown.net/
User avatar
OpenXTalkPaul
Posts: 1871
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: keyDown, keyUp, headBang

Post by OpenXTalkPaul »

richmond62 wrote: Wed Mar 20, 2024 4:30 pm The Thor thing was so cheap because here in Bulgaria the type of people who play computer games are desperate to be the leaders of fashion: and I found the Thor thing "somewhere smelly round the back" of the store (i.e. on a shelf labelled 'old stock').

https://youtu.be/nxTnJPIl20U

Whoops:
-
Screenshot 2024-03-20 at 18.31.42.png
Well yeah, the Extension module needs to be installed or dynamically loaded before its functions can be called. If the library is installed and/or loaded you still have to call a function that initializes it and scan for available HID devices. Even if this was integrate into the IDE, I probably wouldn't want it to actually load and initialize the library unless it was actually being called by a script.

I should also point out that some devices may show up more than once but with different HID profiles. For example a Game Controller with dual analog sticks might have a 'mode' button in the middle, that changes the profile and the analog sticks send a diifferent signal than if that mode button is off. With something like your Genesis Thor 100 device (assuming it is an HID Device) the lettered keys might show up as a keyboard device while the thumb trackball shows up as a mouse or pointing device.
User avatar
OpenXTalkPaul
Posts: 1871
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: keyDown, keyUp, headBang

Post by OpenXTalkPaul »

I don't think there's anything wrong with using old or cheap generic devices if they do what you need them to do.
I have a few old/ odd devices I've picked up over the years, wireless keyboard+trackpads in particular, like these cheap wireless mini handheld keyboard/trackpad controllers, I've used them for keyboard input for Android/Smart TVs and with my Arcade cabinet (for when it drops down into an OS/file browser or opens a web Browser window)
HandheldMicroKeyboard.jpg
HandheldMicroKeyboard.jpg (181.56 KiB) Viewed 2231 times
I also have two larger keyboard+trackpad devices from Logitech.
User avatar
richmond62
Posts: 3264
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: keyDown, keyUp, headBang

Post by richmond62 »

No; of course there is nothing wrong with that: I am now at work with a Belkin Nostromo n52 connected to my 2018 Mac Min running MacOS Sonoma, and I am typing this on one of about 8 Mac Pro Keyboards from 2002 that I own, and, to my mind, are the best Apple keyboards after the end of ADB connexions.

I used to have 2, but my younger son "stole" one to use as a controller on his DJ rig at a series of concerts in a WWII bunker on Cramond Isle in Scotland.

As there is no driver for the Belkin n52 for any 64-bit-only MacOS, the keyDowns are this:
-
SShot 2024-03-21 at 12.16.19.png
SShot 2024-03-21 at 12.16.19.png (53.19 KiB) Viewed 2203 times
-
Which is effectively useless, as those keys are "right there" on my keyboard.

Frankly the ONLY reason I have the n52 connected at the moment is far "farting around" to see what I can do with OXT.

I really have a quite violent urge to find the person(s) who thought up the idea of planned obsolescence and do something really horrible to them.

Of course: IFF one can differentiate keyDowns from the n52 and the keyboard a lot of "fun" can follow.

This thing, at least, yields the arrow keys:
-
wobbler.png
wobbler.png (30.33 KiB) Viewed 2202 times
-
Although, as I have amply demonstrated here and 'over there' many times: xTalk and arrowKeys are not always the best combination in games.

The orange button is the equivalent of CTRL on MAc.
https://richmondmathewson.owlstown.net/
User avatar
richmond62
Posts: 3264
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: keyDown, keyUp, headBang

Post by richmond62 »

Looking at the n52 manual (only any good for a driver that worked for 32-bit Macs) I am green with envy:
-
SShot 2024-03-21 at 12.38.07.png
SShot 2024-03-21 at 12.38.07.png (304.13 KiB) Viewed 2198 times
-
If one could set things up something like that, so whenever Chummy connected their "whatever" gamepad to their computer it could be used to send a different set of signals to an OXT standalone from the signals sent by the keyboard . . .

https://archive.org/details/manualzilla-id-7381877
-
SShot 2024-03-21 at 12.48.09.png
SShot 2024-03-21 at 12.48.09.png (56.32 KiB) Viewed 2196 times
https://richmondmathewson.owlstown.net/
User avatar
OpenXTalkPaul
Posts: 1871
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: keyDown, keyUp, headBang

Post by OpenXTalkPaul »

richmond62 wrote: Thu Mar 21, 2024 10:41 am Looking at the n52 manual (only any good for a driver that worked for 32-bit Macs) I am green with envy:
-
SShot 2024-03-21 at 12.38.07.png
-
If one could set things up something like that, so whenever Chummy connected their "whatever" gamepad to their computer it could be used to send a different set of signals to an OXT standalone from the signals sent by the keyboard . . .

https://archive.org/details/manualzilla-id-7381877
-
SShot 2024-03-21 at 12.48.09.png
Apparently, based on the manual link you posted, on this page: https://archive.org/details/manualzilla ... 9/mode/2up ... this Belkin thing IS an HID device, so you could totally use the HIDAPI extension to map it's signals in OXT to input alternate characters, trigger scripts, whatever.

However, I can NOT make the mappings for you because I don't own that device (and I can't even find a used one for sale).
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests