Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QM Mouse and Keyboard Detector
#1
Is there anyway to set up a program that will automatically register a usb mouse plugged into my laptop as a FF_Mouse 2?
I'll also need the same thing for a keyboard.

Thanks,
Jimmy Vig
#2
i can't help you with code, but as trigger event log could be used.

Macro
Trigger $l "HardwareEvents"     Help - how to add the trigger to the macro
Code:
Copy      Help
function $source eventtype eventid $message
;eventtype: 1 error, 2 warning, 4 information, 8 success audit, 16 failure audit
key Cp
1
int hwnd=win()
SelectTab(id(12320 hwnd) 1)
key TTTVY

i have no idea how to use such triggers.
Confusedhock:
pi
#3
That's probably what it will be...

Just need to understand Gint's masterpiece that is the Keyboard and Mouse Detector.
#4
There is no event that triggers when a usb mouse is plugged in or unplugged that I can monitor so far with QM.

I turned on all the output logs...nothing.

I set up a trigger like _pi suggested...nothing.

Maybe QM is not capable of it...yet!

I found this post from ken gray that has gone unanswered for 5 years Hardware arrival

Thanks,
Jimmy Vig
#5
Ok..So I played around with this.

If I do this at the beginning of the keyboard_detector macro
rset "03000000D55B117300000000D55B11730000000051608298251615B95160829851608298D5" "data" "\KD"

Basically preconfiguring the g_rir variable I can get the mouse to register without having to double click with it in the dialog. It only works in conjunction with one USB port...which is fine.

Now is there a way to get it to always register a mouse in a certain USB port as FF_Mouse 2 on Start-up?
#6
TheVig Wrote:Is there anyway to set up a program that will automatically register a usb mouse plugged into my laptop as a FF_Mouse 2?
I'll also need the same thing for a keyboard.

Thanks,
Jimmy Vig


I could not find a way how to do it.
#7
I guess it is not necessary at all to trigger an event when a mouse is plugged in...

Basically I just want to have a the mouse and keyboard filters configured for a certain set-up and bypass the keyboard_detector dialog where I have to click on stuff in a dialog to get it to all work.

Like...add a button in the keyboard_detector macro that uses the current settings to create a default that will run automatically when QM starts. This way I can get all my stuff plugged in certain USB ports...register all of my mice and keyboard devices...then click the button...Whammo...never have to do it again as long as I keep using the same set-up.

It's necessary for me to be able to unhook everything, pack it up, move it, set-up, and go without a lot of configuration time.

Also, is it possible to expand the keyboard and mouse filters to utilize more than 4? I don't really need that many, but I am curious none-the-less.

Jimmy Vig
#8
It is possible to rewrite keyboard_detector so that it can autoconfigure itself. It could get lists of devices and associate with filter functions. The problem is that the order of devices in the list is undefined, and the devices don't have some unique ids (device name depends on device, USB port, and don't know on what). Sometimes it will associate mouse1 with filterfunction1, sometimes mouse1 with filterfunction2, etc. When a device removed or is in another USB port, will associate other devices with wrong filter functions. Some devices in the lists even don't exist, and I don't know what devices are real. And I cannot test everything on many computers to make it all enough reliable. And similar problems.

Quote:Also, is it possible to expand the keyboard and mouse filters to utilize more than 4? I don't really need that many, but I am curious none-the-less.
Need to change the code in several places and add more filter functions.
#9
A couple questions.

How do I easily output the RIDATA variables?
Last time I snagged it by using rset to an ini file and reading it there.

QM says type mismatch what ever I do.

I just plan to run a macro that uses the g_rir variable set to what I need it to run a certain configuration.

What do I need to change in keyboard_detector to have "use multiple mouses" checked? I can't seem to find that.


---All of this is really over my head. I give up.
#10
Macro
Code:
Copy      Help
;out g_ri ;;type mismatch
out _s.getstruct(g_ri 1) ;;ok, converts to string

----

if(g_rir.flags&1) c10Use=1
if(g_rir.flags&2) c11Use=1

before insert g_rir.flags|2

Or change this
if(!rget(g_rir "data" "\KD")) g_rir.flags=3
it means, if detector runs first time on computer, ie its options still not saved in registry, use flags 3 (flag 1 - use keyoards, flag 2 - use mouses)
#11
So I might have to open wide and insert foot in mouth...

But I think I just didn't see that the keyboard detector already did what I need it too and I have been fretting over nothing.

I'll play around with it a little more on the computer I am trying to set up and fill you in.

I think I just got it in my head during early set up that I needed it to perform a certain way. Sorry to waste your time. Thanks for all your help anyway,

Jimmy Vig


Forum Jump:


Users browsing this thread: 5 Guest(s)