Version for the DreamCheeky Big Red Button

Oct 2, 2012 at 11:44 PM

Based on this (which is fantastic by the way) I created a version for the DreamCheeky Big Red Button which has a slightly different USB device ID and button status byte...

a) Default USB device ID: 0x1D34,0x000d,0

b) Cover is open and Button is pressed: Byte 1 value = 0x16

Source of these values: http://files.dreamcheeky.com.s3.amazonaws.com/uploads/dc/902/Big%20Red%20Button%20-%20Developer%20Manual%20v1.0.pdf

If all you want is an exe that works the same as described here, but for your "Big Red Button" you can download it here: http://jpelectron.com/sample/JPElectron/DreamCheekyBTN%20for%20BigRedButton.zip

Keywords to help searchers find this: DreamCheeky, Big Red Button, command line, start program, custom program, custom driver, USB button

Jan 11, 2013 at 4:20 AM

Excellent! 

Apr 17, 2013 at 1:33 AM
Thanks for doing this! Using the red button to activate the control console for my usb missile launcher, also from Dream Cheeky. I appreciate your work!
Dec 5, 2013 at 1:44 AM
This is great, thank you so much!
Unfortunately, I can't seem to figure out how to get it to work. Double clicking the .exe opens a command prompt for second and that's about it. The Button still only responds to the Dream Cheeky software, and uninstalling got me nowhere.

I guess my first issue is that I basically don't understand how to connect it to the button itself. It's a driver, correct? When I got the Big Red Button, it installed its own driver, and I'm not sure how to override it with this one, if that's what needs to be done.

And then how exactly do you set this up to launch an .exe?

I'm so sorry for the questions! I'm completely new to this and have very little to no idea what I'm doing, but I would really appreciate a little instruction, if you wouldn't mind.
Dec 5, 2013 at 8:21 PM
Edited Dec 5, 2013 at 8:23 PM
Please see the Readme.txt file inside the .zip file...

The DreamCheekyBTN.exe provided is a console program, meaning it requires some parameters, for example...

DreamCheekyBTN.exe CMD=c:\temp\test.bat

...this would mean when you press the button, it will run c:\temp\test.bat

When DreamCheekyBTN.exe is running, it's "listening" for the button press. If you want to start the software every time your computer runs, you would need to make a shortcut to this .exe and include the parameters, then put this shortcut in your startup folder.

If you don't like that the console window is open all the time, then you need to get a copy of Visual Studio, download the source code, and modify it how you see fit.

It will not work if the software included from the button manufacture is running at the same time. It's been awhile since I looked at this, but I don't believe the manufacture software even needs to be installed once (for the sake of loading any driver). Rather, allot of the USB buttons show up as an HID device (just like a keyboard, so no special USB driver is needed) when you press the button, or open the lid, it's actually sending a special "keystroke" that isn't a normal keyboard key like pressing A or X, this software picks up that signal and, in turn, runs your other program specified after CMD=
Dec 29, 2013 at 3:26 AM
Thanks so much for responding! I'm working with Visual Studio 2013, and the button works and responds when tested with that program in debug mode, but when saved and then used outside of Visual Studio, it doesn't seem to work. In Visual Studio, I can't seem to get it out of debug mode. The solution configurations drop down menu is greyed out and I can't get it to release. Could that be the problem?
Dec 30, 2013 at 3:15 PM
Mar 22, 2014 at 8:00 PM
Edited Mar 22, 2014 at 8:40 PM
So I've got the button and DreamCheekyBTN.exe and AHK all installed, I must be really close to having it working, but for the life of me can't get the button to send a macro that presses [X][E][E][E]. I imagine I'm screwing up the device id in the AHK file. I've found the button in my device manager, but don't know what I need to put in the AHK file. Any help?

Here's my AHK
Run, C:\DreamCheekyButton\DreamCheekyBTN\DreamCheekyBTN.exe device="0x1D34,0x000d,0" MACRO="xeee" ;,,Hide
;Above will start the DreamCheekyBTN program to listen for button presses and convert them to [X][E][E][E]
;Change ;,,Hide to just ,,Hide to start program in hidden mode.
EDIT: Never mind, somehow I got it to work!

Current code
Run, C:\DreamCheekyButton\DreamCheekyBTN\DreamCheekyBTN.exe MACRO=xeee ,,Hide
;Above will start the DreamCheekyBTN program to listen for button presses and convert them to [X][E][E][E]
;Change ;,,Hide to just ,,Hide to start program in hidden mode.
I guess removing device did the trick. Hopefully it works when I plug into a different usb port/usb hub.

EDIT 2: Now I have another problem. The application I'm trying to use it for doesn't register the keystrokes, I imagine it has to do with the lack of delay between the strokes. Is there a way to insert a delay (~10 ms) between xeee.
Mar 23, 2014 at 4:00 AM
Not sure what you're trying to do...

1) use AHK to detect "xeee" and then run DreamCheekyBTN.exe monitor, so you could press the button and do something else?
or
2) press the red button and then have it type "xeee" for you?

...not sure why AHK software is involved here for #2, as you don't need it, just run the button monitor and it can send the keystrokes for you...

DreamCheekyBTN.exe MACRO=xeee
Mar 23, 2014 at 4:08 AM
Scenario 2.

My exact application for it will be as an "eject button" in the new game Titanfall, where you pilot giant mechs/robots and need to eject when your mech is about to die. The way to eject in Titanfall is to hit "x" to initiate it then hit "e" three times to complete the action and launch from the cockpit. All I want the button to do is to input xeee while playing that game.

I got the button to input xeee, but the game couldn't detect it, but my other macros for it do. The only difference between what I got the button to do and my other macro is delay between keystrokes. My Corsair K95's macro has a 10 ms delay between each keystroke in xeee. The game doesn't even detect the 'x'. I don't even need the button to input a "key release" state, only key actuation. Does that make sense?

Thanks for the response btw.
Mar 23, 2014 at 4:29 AM
Cool idea, if you want to use AHK take a look at: http://www.autohotkey.com/docs/commands/SetKeyDelay.htm

There is also another way, not requiring AHK, perhaps better...

DreamCheekyBTN.exe CMD=myfile.vbs
For examples of what to put in myfile.vbs
see: http://ss64.com/vb/sendkeys.html
or: http://msdn.microsoft.com/en-us/library/8c6yea83(v=vs.84).aspx

or with the script host...
DreamCheekyBTN.exe CMD=wscript myfile.vbs
see: http://technet.microsoft.com/en-us/library/ee156587.aspx

The issue might not be the delay, but simply trying to send ANY keystrokes to the Titanfall game via software (as opposed to the hardware/real keyboard input) I seem to remember some games having a protection against software keystrokes to prevent cheating. If that is true, you might have to make a purely hardware device; off the top of my head...
a) Wire a SPST pushbutton into an arduino, which will then "press" the keys, code example: http://arduino.cc/en/Reference/MouseKeyboard
b) Wire a SPST pushbutton to a series of relays, which would "short" the pins for X followed be E three times on a taken-apart keyboard, example: http://computer.howstuffworks.com/keyboard2.htm
Mar 23, 2014 at 4:43 AM
I'll try the soft stuff for sure. I hadn't thought about anti-cheat though, that's a good point. Modifying hardware is a bit too involved for me. Thanks for the tips though.
Apr 20, 2014 at 3:27 AM
FYI, I submitted a Pull Request to merge support for the Big Red Button into the original codebase so that it will support both types of buttons.

Now off to play with the DreamCheekyLED...
Apr 20, 2014 at 10:51 PM
Hi guys!

I was about to buy this USB button, but then I realized nowhere says it supports Mac.
So I would like to know if OSX recognizes the button as a keyboard, as I would like to use it only as a keystroke (one key only)?
Apr 21, 2014 at 3:10 AM
OS X does NOT recognize it as a keyboard, but I have a MacBook, so let me see what I can do… pretty sure I can make this work for you.
Apr 21, 2014 at 10:00 AM
Thank you! I am using Lion (10.8.5) if it helps.
May 5, 2014 at 4:33 AM
Edited May 5, 2014 at 4:36 AM
Hi SomeSauce,

So I was able to port this from using HidLibrary to HidSharp, which is cross-platform. It works, but being a .NET command-line utility, it requires Mono be installed to run it from the command-line. Not incredibly user-friendly but when I finish cleaning it up I will make it available.

I'm also going to see if I can turn the DreamCheekyBTN program into a small Mac app with a little menu bar icon while it's running. That would be a lot easier to use.


Incidentally, I also got the DreamCheekyLED program ported, with one limitation… I can't seem to get the System.Drawing.Color.FromName() call to work on a Mac, so for now, you can only turn the LED on with an RGB setting or off… no blinking or fading since those require a System color. I have a few ideas for workarounds that I will try tomorrow evening.
May 5, 2014 at 9:20 AM
Hello PiperMatt,

Thank you a lot for your work. It seems like you figured out a lot already.
Menu bar app sounds amazing, but command-line is fine, too.

My button is on its way, I ordered it the day I first posted here.

Take your time, and hear you later.
May 6, 2014 at 6:08 PM
I now have all functionality of both the DreamCheekyLED and DreamCheekyBTN programs working on Mac.

In the process of doing that, I discovered that while Windows uses 9 bytes to communicate over the USB connection, it appears Mac OS X only works with 8 byte messages... so I now need to circle back and use System.Environment.OSVersion.Platform to determine what platform the code is running on and send the correctly-sized control messages.

Once that is done, theoretically the same executable will run on Windows, Mac & Linux without recompiling.

(Incidentally, I'm planning to use my DreamCheekyLED as a Jenkins Build Status Notifier... so I'm also working on a DreamCheekyWS (web service) that will run on my development machine. This will allow my Jenkins Build server (in my server room) to control the DreamCheekyLED sitting on my desk (NOT in the server room) to indicate the status of the build. Nifty! I'll share that when it is complete as well.)

Lastly, I looked into the OS X menu bar app... definitely doable. I found a great sample that I can use as a starting point.
May 12, 2014 at 2:52 PM
Hi,
my button has just arrived.

What is the progress? Do you maybe have something to send me I can test out on my Mac?

Thanks!
May 12, 2014 at 3:21 PM
Edited May 12, 2014 at 3:23 PM
Definitely! I can post the command-line source & executable when I get home from work tonight. Right now I'm using the HIDLibrary DLL, so for now you will need both the DreamCheekyBTN.EXE and HidLibrary.DLL files.

I do have the HIDLibrary source, so I can include it in the project so there will be no external DLL required. Just haven't done it yet. That part should only take a minute or two.

EDIT: I DID test it on my MacBook and was able to use the BigRedButton to launch a program. Hopefully it works for you without issues.
May 12, 2014 at 3:29 PM
Awesome, I'll check it out when you post it.
May 13, 2014 at 4:25 AM
Edited May 13, 2014 at 4:30 AM
I have updated my fork with the code changes… I discovered that I may not have the Windows compatibility sorted out yet. I will fix it eventually… but for now, the Windows folks can use Greg's original code so it's not incredibly pressing.

If you don't want to build it from the source, you can download the release version of the executable here:

https://www.dropbox.com/s/3xmsr8cw02dfkl3/DreamCheekyBTN.zip

I need to update the Readme as well… it still mentions HidLibrary. I need to update it to reflect HidSharp and it's license information. Lastly, if anyone wants a Mac-compatible executable for the DreamCheekyLED let me know. That one works too.


EDIT: I did go ahead and include the HidSharp source so that the .EXE is all you need. Well, all you need besides the Mono runtime.
May 13, 2014 at 8:54 AM
Thanks a lot man!

However, I still need some guidance.

I ran executable through terminal with mono command.
I managed to set it to run an app or file!! It really worked, it detects the button just fine, and I find it interesting that it can detect closing and opening the lid, too.
While setting it to output a keystroke with MACRO command, I had no success. In terminal window I can see 'Sending keys: ...', but no application detects it.

Please could you tell me what I can do, because I'm probably doing something wrong.
May 13, 2014 at 12:53 PM
Ahhhh my apologies. Clearly I neglected to test that portion of the code very well. I was so focused making sure the USB communication worked, I didn't pay enough attention to that.

Sorry for any frustration that caused… let me take a look.
May 13, 2014 at 1:33 PM
Edited May 13, 2014 at 1:39 PM
Ahhhh so yes, I must have completely overlooked this, because the DreamCheekyBTN application uses Mono's System.Windows.Forms.SendKeys() to send the keystrokes set up with the MACRO command. Unfortunately, System.Windows.Forms.SendKeys() is not implemented on Mac OS X.

I have found some possible solutions, but I have to head to work. I will play with it some more late tonight.

EDIT: I found a way to do this via Apple's native Objective-C, so I should be able to create an Objective-C library that I can call from C#.
May 13, 2014 at 1:42 PM
You don't have to apologize for anything. I don't want to take too much of your time, do it when you can, there's no hurry.
And thank you once again.
May 13, 2014 at 1:50 PM
Oh no worries. I'm enjoying the challenge / learning new things. It's always more rewarding to learn new things when someone else is benefiting from your learning, rather than purely academic exercises.

And as they say, "Necessity is the mother of invention" and stuff. :)
May 26, 2014 at 2:51 PM
Hi Piper,
do you have any news?
Aug 1, 2014 at 2:52 AM
Edited Aug 1, 2014 at 3:05 AM
I think I got my photo booth button!
Nov 13, 2014 at 7:49 PM
Hey, excuse me. Really sorry for bothering you guys, but I can't seem to get my button to work. I'm having the "CMD window pops-up, then goes away 0.25 seconds later." issue, and I've read the ReadMe file at least 15 times, ive gone over the replies at the top of this page, and here's where I am:
I have read the ReadMe.txt thoroughly.
I understand that the DreamCheekyBTN.exe is a "Command Line" program.
I understand that the above statement means the program needs a command to run properly.
I understand that the syntax for an example command is "DreamCheekyBTN.exe debug MACRO=ASDF~".

I have absolutely no idea where to put this command.
Do I put it in the command window? Because that closes immediately like I was saying.
Do I put it in a batch file that runs the DreamCheekyBTN.exe from its code?
There is no "target" property when I right click the .exe, so I can't put it there.


All help is greatly appreciated. Sorry again...
Jan 12, 2016 at 12:58 PM
question - does the command line exe include an option to perform an event when the cover is opened or closed?
Feb 2, 2016 at 10:36 AM
Edited Feb 6, 2016 at 3:44 AM
I also have the issue with the Command prompt immediately closing. There is no easily identifiable place to input the parameters required for the program to function correctly. I would really appreciate a solution here. Sorry if it's a bother, but if anyone knows how to set parameters, could they please post a guide.
Edit: I found some instructions online. I'm putting them here in case anyone wants them.
  1. Plug in the device and install the drivers.
  2. Open and unzip the file into a folder.
  3. Open Notepad and type in a command, eg. DreamCheekyBTN.exe CMD=calc
  4. Save as a .bat file into the same folder as the .exe.
  5. Double-click on the .bat file,
  6. Press the button.
Mar 1, 2016 at 2:36 PM
mixedmsgs wrote:
question - does the command line exe include an option to perform an event when the cover is opened or closed?
I also very much want a way to recognize when the door is open.

There's a different 'kesytroke' the HID sends when the door is open. Just a second executable could do the trick.

Example would be you run DreamCheekyBTN.exe (Command 1)
and DreamCheekyBTN_LID.exe (Command 2)

Thus when you open the button Command 1 runs to play an alert sound, then pressing the button (Command 1) executes some action and turns off the alert sound.


JPElectron's last reply was in 2014, so it would be pretty remarkable if he came back to tweak it for us.

Anyone else have an idea on how to reverse engineer this exe to create a LID version?