Log in

View Full Version : ClonedKeys - the continuation of OS X key broadcasting



alphaquam
08-22-2008, 12:20 AM
ClonedKeys
Mac OS X key broadcasting application
This is the continuation of the CloneKeys project, originally developed by rjenkins8142.

New features:
Ability to restrict broadcasts to only those applications indicated in the ClonedKeys window (no more guild chat embarrassment!). Ability to blacklist the standard WASDQE movement keys (no more fumbling when switching windows to move your characters!).Upcoming features:
User-defined keys to switch application focus (thanks to Otlecs for pointing out need for clarification).
• User-defined key broadcast linked with above feature (compliments of wetstreet). User-defined key blacklists. User-selectable per-application key translation/modifiers.
The latest version is always available on Google Code ('http://code.google.com/p/clonedkeys/'). Please post any comments/suggestions/issues in this thread. I would kindly ask that, if you find a reproducible issue, please submit it through the Google Code Issues ('http://code.google.com/p/clonedkeys/issues/entry') interface.

antishadow
08-22-2008, 12:43 AM
Yes! Thank you so much for picking up this project. I had hacked in the ability to not have it send WSAD but had it hard coded and only got it in there after a couple hours of fumbling around using the trial-and-error method.

wetstreet
08-22-2008, 05:16 PM
Awesome stuff! I updated the CloneKey entry in the wiki and added a link to ClonedKeys.

Your two upcoming features will get rid of my horribly hacked version (I use SDFC instead of WASD to move). Currently I send a keystroke to each client when the front window changes and the client changes which action page they are using. It gets the job done but is a hastle to setup and maintain. Depending on how you plan to do the key mapping I think I can get rid of all that and greatly simplify my setup.

One feature that I hacked is to send a keypress when the selected client changes. (in MonitorHandler() under kEventClassApplication look for the kEventAppFrontSwitched event kind then send the keystrokes if everything matches up) Right now I send a different key combo for each selected client (^1,^2,^3...) but I plan on changing that to sending one key combo (the same for everyone) to just the new front application.

Another feature that I wanted, but couldn't get to work in C++ was to switch from one client to a specific one of my 5 with a keypress (also triggering an action in the clients). Right now, I'm using ControllerMate and a bit of Ruby with appscript to switch clients by using ps and grep to find the process ID. Ugly, but a lot faster then I was expecting it to be.

While I can hardcode what I want to do, I'm on the wrong side of the learning curve for Mac UI code. :P Keep up the good work!

tzibo
08-24-2008, 04:46 AM
Wow - immense. I'd read that you were thinking of doing this - nice work to take it on. I'm looking forward to giving this a go. :thumbsup:

One question I have is have you been able to try out more than 2 clones with it? On the original version there was always the problem that having 3+ in the list would mean that some keypresses weren't replicated properly?

alphaquam
08-24-2008, 01:37 PM
I have only been using it with two clients, although I do have 3 accounts. At some point I will fire up 3-5 and see what kind of issues arise.

Otlecs
08-25-2008, 06:18 AM
User-defined key broadcast on application focus change
I am pretty sure that this is against the WoW ToS.

alphaquam
08-25-2008, 10:35 AM
User-defined key broadcast on application focus change I am pretty sure that this is against the WoW ToS.
I agree, sending a keystroke via the focus change event itself could likely be a violation of the ToS in many situations. However, sending a keystroke in response to another keystroke that changes focus should be fine. Therefore, by tightly coupling this functionality to the "define keystroke to switch to client" feature, I think we'd be in the clear.

If someone has a definitive answer on this, please let me know. Thanks for bringing it up, Otlecs, I will clarify in my original post.

alphaquam
08-25-2008, 10:57 AM
The wiki is now active and available on the Google Code site.

wetstreet
08-25-2008, 01:09 PM
User-defined key broadcast on application focus change I am pretty sure that this is against the WoW ToS.
I agree, sending a keystroke via the focus change event itself could likely be a violation of the ToS in many situations. However, sending a keystroke in response to another keystroke that changes focus should be fine. Therefore, by tightly coupling this functionality to the "define keystroke to switch to client" feature, I think we'd be in the clear.

If someone has a definitive answer on this, please let me know. Thanks for bringing it up, Otlecs, I will clarify in my original post.That's what I have setup now. Using ControllerMate and a bit of ruby I've got a key that I press that changes which client is front (one key per client). If I hold the key down for more then 1/2 second, then a keypress is sent to the client.

On another note, I think I know what is going on with lost key presses. I was testing with a number of text editors and found I could get them in a state where they thought the CMD key was pressed even though it wasn't. It was easy to spot since I hit the S key and the Save dialog popped up. :D Changing to that client then press/release the CMD key and it started working again. How and why it happens, I havn't figured out yet.

Redempshin
09-04-2008, 09:08 PM
Is there a native way in Mac OS X to bind a keyboard command to stop/start cloned key? Maybe a way to build it into cloned keys (it's obviously monitoring keyboard entries in someway).
It's embarassing to say something on the main char and have it come out duplicated (or usually in near gibirish missing qweasd).

Great application.
Thanks for your work on it (current and future)

alphaquam
09-05-2008, 11:39 AM
Is there a native way in Mac OS X to bind a keyboard command to stop/start cloned key? Maybe a way to build it into cloned keys (it's obviously monitoring keyboard entries in someway).
There is a way to do this already. Under Preferences, click the "Edit Override Hotkey" and press any key the click "OK". Now, whenever you push that key, it will stop/start (toggle) ClonedKeys. I have my own mod to prevent my slaves from speaking, though (so I don't have to remember to turn off ClonedKeys)... I've been meaning to post it. I will do so soon.