Posts: 1
Threads: 1
Joined: Sep 2008
Is there a mouse macro program out there that will trigger a macro via external, USB input?
Please help my very sanity depends on finding a solution!!!
Ok here's the scenerio. I'm doing a corprate tour where I have two trucks on dynomometers that run 1/4 mile drag races every two minutes for eight hours. I'm the A/V guy. I have a 16' LED screen that shows a logo and commercials, then during the race I show the telemetry from each truck on the screen. I'm using a computer program that allows me to store and recall screen layouts. All day, every day, I hear on the radio "go for lights" at which time I click on Preset 1. A 1/4 mile drag race begins. 60 seconds later, I click Preset 2 which takes the screen to logo. I'm faced with clicking a mouse 440 times for 9 days straight on an upcoming gig and was wondering if there was anyway to automate these events. The caveat is that the primary event needs to be triggered by outside input, probably the drag race xmas lights. I can use a voltage sensor from the drag race x-mas lights, a photo sensor, amp probe or other such sensors, but I haven't come up with a computer macro program that will allow outside triggering. I need some sort of USB device that will trigger the macro to begin when the race starts.
Here is the challenge to save my sanity:
The screen begins in Logo or Preset 2.
The xmas lights trigger the switch (some USB device attached to a voltage, photo or other sensor) which changes the screen to Show or Preset 1.
After 60sec, I change the screen back to Logo or Preset 2.
A manual override feature would also be nice just in case there is a botched run.
As for the mouse macro idea, I've seen one program that will trigger an event from a pixel color change. I could make that happen with a pcb camera on the red light sent to a video to usb capture module and put the open window in the background. This just seems a bit kludgy.
Any ideas? I'd love to hear them.
Thanks for your help.
xiansam@gmail.com
Posts: 12,074
Threads: 141
Joined: Dec 2002
With Quick Macros you can create trigger to run a macro when brightness of certain pixel on the screen becomes >= than specified value.
Function PixelBrightnessTrigger
;change these values
int brightness=90 ;;brightness threshold, %. Can be 1-100.
int x(100) y(100) ;;pixel coordinates
str macro="Macro528" ;;macro to run when brightness of the pixel becomes >= the threshold
;to start the trigger, run this function
;it adds tray icon 'lightning'
;to stop previously started trigger, run this function again or Ctrl+click the tray icon
;-------------------------------------
if(getopt(nthreads)>1)
,shutdown -6 0 "PixelBrightnessTrigger"
,ret
AddTrayIcon "lightning.ico"
int plum
rep
,0.01
,;x=xm; y=ym ;;gets mouse coordinates. Can use this for testing
,int c=pixel(x y)
,word hue lum sat
,ColorRGBToHLS c &hue &lum &sat
,lum=lum*100/240
,;out lum ;;shows pixel brightness, %. Can use this for testing
,if(lum>=brightness and plum<brightness) mac macro
,plum=lum
Posts: 1,000
Threads: 253
Joined: Feb 2008
If you have a parallel port and you can get a switch to open/close via a relay or something like a photoresistor that would open a circuit...then you could easily just use a set up with that.
The parallel port provides 5V on the pins when configured right...when you short it to ground it pulls the pin low. With the right dll...this is easy to grab. With the right photoresistor, you could open the signal from a voltage pin to ground...therefor activating a program command.
On most computers the status, control, and data pins can be configured to read data...that's 17 different inputs on the parallel port!
Too bad your probably on a laptop and do not have a parallel port. I don't know if the Parallel Port to USB converters work...I haven't tried them out to see how they actually register as a port.
Another way to do something like this is through midi....of course you'd have to have a trigger to midi converter...used $150ish...and you'd have to have a midi to USB converter...like $50 for a cheap-o..M-Audio is about the cheapest you'll get. Then you'd have to figure out what would trigger the Midi.
Posts: 121
Threads: 33
Joined: Jun 2007
If you're not familiar, PI Engineering ("The no slogan company" ; ) has some excellent tools for real world-to-computer triggering that may be of help in your endeavour. In fact, it was through their X-Keys products (I'm using their Joystick, Shuttle and Button Panel controllers in a recording studio/production context, but predominately just as direct interfaces with existing software platforms) that I got into QM in the first place.
Though I'm not using their relays or contact closure stuff, the interfaces seem relatively simple and they have excellent support (like here!). Start here:
http://www.xkeys.com/custom.php
...but also have a look at the main page in case it takes you in a different direction.
Very good (and creativity-inspiring) stuff...
S
[edit] Here's their simple 12-switch to USB interface. Hope this isn't a problem posting this info, but I think it may be of value to many QM programmers who may want to trigger from real world events:
http://www.xkeys.com/xkeys/xkswi.php
Quote:Any switch can trigger an action from your computer. Connect up to 12 switches to the X-keys USB Switch Interface and program each switch with a function. Any keyboard shortcut your software uses can have a designated switch (copy, paste, save, open, close). Switches are easily set up to launch applications, open files, or type short lines of text like names, addresses, and account numbers. Switches are connected via Assistive Technology standard 3mm (1/8”) phone plugs.
Posts: 1,769
Threads: 410
Joined: Feb 2003
yeah, those are nice boards.
I have the big 56-key (?) one that doesn't use the usb interface. Used to use it alot till Gintaras got the 2nd-4th keyboard detectors up and going.
will sell my PI eng if you want.
Posts: 121
Threads: 33
Joined: Jun 2007
Thanks for the offer, but I've got enough keys for now. I'll probably try experimenting with their switch/closure to USB interface at some point, though...
Posts: 1,000
Threads: 253
Joined: Feb 2008
http://www.quickmacros.com/forum/showthr...p?tid=2664
I have developed a bit more hardware with this. I use contacts that close circuits to ground in combinations...for example...one button closes pins 1,2 and 8 which triggers a corrisponding program...I can read 17 pins on the parallel port...that gives me the ability to add thousands of buttons. It kindof works like an autoharp
Posts: 175
Threads: 43
Joined: Jun 2004
Here's what I'd do (and have done for other solutions).
--Use a microcontroller or single board computer (SBC) to gather and process external data. Parallax sells the Basic Stamp (SBC) which is quick and easy to learn. This one would suit you well. Its only about $40.
--Communicate with the PC via the SBC's serial interface. The SBC above has a USB interface, but the computer will see it as a virtual serial port (ie-COM1, COM2, etc)
--Install this ActiveX control. It will allow QM to access serial ports in order to communicate with your SBC.
--From there its up to your imagination and programming skills.
I know this is vague. I'm open for questions.
Matt B
Posts: 1
Threads: 0
Joined: Sep 2012
I just need to know after hours of searching is there a program that will allow you to build your button layout and name each button and assign macros to each button, all will be done on screen, I was thinking of doing this with a digitizer tablet but there so bulky, :? I was hoping to do all this onscreen and I have hundreds of macros and will be making many more so keyboard is out.
Posts: 12,074
Threads: 141
Joined: Dec 2002
In Quick Macros you can add macros to user-defined toolbars. A toolbar can be attached to a window or free (floating anywhere on screen).
Cannot design complex toolbar layouts. Buttons are autosized and autoarranged.
Can create dialogs with standard buttons.
Posts: 1,000
Threads: 253
Joined: Feb 2008
I would say a multi-page dialog with buttons could be hyper cool for a tablet running windows. With the multi-page you could group buttons together by page for easier access.
You can size, color, move buttons pretty easily with the dialog editor and code.
Gintaras, is there anyway you can think of where you could right click on a dialog button and assign a function to it? (Possibly assign QM macro, executable, play an MP3 file, assign midi, etc). Perhaps change button colors with a a right click menu that would bring up a color picker.
Posts: 12,074
Threads: 141
Joined: Dec 2002
Function dialog_button_assign_macro_at_run_time
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
if(!ShowDialog("" &dialog_button_assign_macro_at_run_time)) ret
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 223 135 "Dialog"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 Button 0x54032000 0x0 6 8 48 14 ""
;4 Button 0x54032000 0x0 6 26 48 14 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2030400 "*" "" ""
ret
;messages
sel message
,case WM_INITDIALOG
,
,case WM_SETCURSOR
,if lParam>>16=WM_RBUTTONUP and wintest(wParam "" "Button")
,,if(!inp(_s "Macro to assign to the button:" "" "" 0 "" 0 hDlg)) ret
,,_s.setwintext(wParam)
,,
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case [3,4]
,_s.getwintext(lParam)
,if _s.len
,,mes _s
,,;mac _s; err
,
,case IDOK
,case IDCANCEL
ret 1
Posts: 1,000
Threads: 253
Joined: Feb 2008
|