Bind/disable a keyboard for XBMC
#1
Hello,
I've been trying for ages to make my media center work the way I want it to, and it looks like every way I try, there is a small problem I can't get rid of Big Grin!
So maybe you'll have ideas to make it work!

Here is what Hardware I have:
In the first room:
- 1 desktop computer (i7 + HD5850)
- Outputs: 1 desktop monitor + headset for the sound
- Inputs: USB Mouse + keyboard
In the second room:
- Outputs: 1 HDTV (Plugged with HDMI to the computer)
- Inputs: 1 Bluetooth Logitech diNovo mini

What I want to do:
- I want to have at the same time XBMC running on the TV (display + sound of course) and the other applications on the monitor/headset
- I want the diNovo mini to control XBMC and only XBMC (no interaction with the other applications)
- I want my other mouse/keyboard to control the other applications but NOT XBMC

So, in bold are the problems I am still having, is there a way to do that?

What I tried:
I tried using XBMC in a virtual machine (with both Vmware Workstation and Virtualbox), but I always had problems (Virtualbox cannot use a specified audio adapter, and Vmware was not working properly in full screen mode, and did not authorize me to connect HID devices on startup).

Thanks a lot for your help!
nbarraille
Reply
#2
You could use an Infrared MCE remote instead of the diNovo keyboard.

You would presumably want XBMC to respond to the remote even when it doesn't have the focus. In that case you would need to use Eventghost to receive the IR signals and direct them to XBMC. I don't know if Eventghost can do this trick for a Bluetooth keyboard.

JR
Reply
#3
Thanks for the tip. I used to have a MCE compatible remote, but I would really prefer to use my dinovo mini. I believe I could do something with eventGhost, it looks like there is a "Generic HID" plugin.


Just to be sure:
- I actually would not be bothered by my other keyboard, because it would interact with XBMC only if XBMC has the focus, so I just have to make sure it never happens
- I would not be bothered by my mouse, because I disabled it in XBMC
- I just have to create a macro in eventGhost that every time I hit a key on my dinovo mini, sends a signal with that key to XBMC, without giving the focus to XBMC, right?

Questions:
- Can I do it with the eventGhost XBMC plugin? When I look at the action list, I do not see anything like this.
- Even when I look at the XBMC API (http://wiki.xbmc.org/index.php?title=Lis..._Functions) I do not find anything to do so.

Thanks!
Reply
#4
Your problem is that keyboards are handled by Windows. There is no way for XBMC to "grab" a keyboard.

With remote controls Eventghost can grab the remote control so that all button presses are intercepted by Eventghost, and Eventghost can then choose which application to direct them to. In principle this can be done with a bluetooth device like your diNovo keyboard, but I've never done it and I don't know if it's something that Eventghost can do (easily).

JR
Reply
#5
I looked at the problem more in depth, and here is what I found.

- It looks like it's not really possible to do it through Eventghost, the "keyboard" plugin does not differentiate a keystroke from one keyboard or the other and the "Generic HID" plugin does not handle mouses and keyboards (I tried modifying the code of the HID class of Eventghost to remove the part that exclude mouses/keyboards devices, but it did not change anything). I could just detect the "media buttons" of the dinovo Mini with the Generic HID plugin.

- I found a program called HID Macros (http://hidmacros.medek.info/news.php) that can differentiate the keystrokes from each keyboard, so it is definitely possible to do so. Unfortunately, this program just offers the possibility to "Send a keyboard sequence" (that is not detected by Eventghost) or to launch a program. So I was thinking of creating one script key I want to bind that could communicate with XBMC. Maybe it could work.
Reply
#6
Ok, I finally managed to make it work, it's pretty good now.

Here is what I did:
- I used "HID Macros" to create a macro for each key of the diNovo mini. Each macro intercept the key when it is pressed and replaces it by another twisted keyboard sequence I would never use (CTRL+ALT+SHIFT+KEY, or CTRL+ALT+Fx for CTRL/ALT/SHIFT keys).

- Then I created a script with "autohotkey" that intercepts the CTRL+ALT+SHIFT+KEY sequence and sends the original KEY to the XBMC window, without activating it.

So far it is working great. Here are some links for my HID macros setup and my autohotkey script, in case anyone is interested.

Thanks!

hidmacros.ini
SendToXBMC.ahk
Reply
#7
Being in transition from Linux to W7, this is exactly what I was looking for (my setup is very similar to yours).

Thanks, I will try it soon!
Reply
#8
Have you guys actually managed to get this working?

My PC is connected to the TV so I run XBMC on the TV while being able to use the monitor for normal PC tasks. I'd like to be able to control XBMC using my diNovo Keyboard without disturbing anybody who might be sitting in the monitor and using the PC.

I have tried Hidmacros however even with it running and being told to intercept the dinovo button and send ctrl+alt+shift it doesn't seem to work. Could it be that it doesn't work well with Windows 7 64?
Reply
#9
Just stumbled upon this thread when I decide to look for a way to use my dinovo exclusively with xbmc too.

Unfortunately if I click on a window like a text editor or the browser in the main screen it seems one of the 2 applications loses focus of the tasks. Not sure if it is hidmacros that does not capture the dinovo input or if it is AHK that does not register the command strokes from hidmacros but something is up.

Otherwise when it works it works well (Apart from the fact I had to change some of the bindings since the keyboard would not register the F keys with ctrl shift alt).

Any help is appreciated to get it working consistently
Reply

Logout Mark Read Team Forum Stats Members Help
Bind/disable a keyboard for XBMC1