Weblog entry #25 for dkg
I suspect that the way to do that is with LIRC (as Utumno mentioned), but i'm not sure what kind of USB infrared devices will be compatible. The NSLU2 only has USB ports -- no RS-232 or anything else. Anyone with more experience in this area care to suggest a USB IR receiver that works well with a TV remote?
Comments on this Entry
well my advice is easier than that
I bought one of those crappy cordless presentations pointers to do presentations in powerpoint. The cheaper the better. It turns out that every time you press the forward key (which would take you to the next slide in powerpoint) my linux detected that the "F" key was pressed, and so on. So basicly the mouse was like a keyboard with 4 keys only (B, F, Home, End)
Then what I do is, with Xmodmap i assigned every one of those keys to an event and then in KDE I assign actions to those events
Since your NSLU2 doesn't have KDE it's even easier
The only thing you would need to do is to execute a script like:
bind B 'mpd --lastsong'
bind F 'mpd --nextsong'
bind Home 'mpd --volumedown 5%'
bind End 'mpd --volumeup 5%'
Or whatever the sintaxis is
The only problem I see is that I don't know if you need to be logged in a tty for the bind command to work, that may be troublesome
Well if you have a USB keyboard you can try for free whether my idea works or not and then buy a "USB cordless presentation mouse" if it does and you will have a nice remote control for your NSLU ;)
Just my 2 cents :/
[ Parent | Reply to this comment ]
[ Send Message | View dkg's Scratchpad | View Weblogs ]
It now occurs to me that i could also just use a USB mouse. it wouldn't be wireless, but if i had 3 buttons and a wheel to work with, maybe i can just get away with that.
[ Parent | Reply to this comment ]
I would not buy anything until you know it's going to work, so I would make the test with an usb keyboard or a usb mouse that u already have
As i was saying u have a big problem in the NSLU. If u press a key in your keyboard, you need a console opened so you can see the result of the pressed key. But what about NSLU, u don't have any opened ttys so even though you press the F key ...where is that keystroke going?? I don't know if u understand what i mean.
Maybe i am very wrong but even though u press one key what process is getting the standard input of that?
We should figure out a way to do this
[ Parent | Reply to this comment ]
[ Send Message | View dkg's Scratchpad | View Weblogs ]
But i'm still looking for what my hardware options are. Do you have a link handy for a really cheap wireless presenter remote like you mentioned in your first comment?
[ Parent | Reply to this comment ]
http://www.softworld.es/labtec_presenter/
It was 20 in a shop around the corner, but i admit it was on sales. I think the trick is that you dn't need drivers to make it work on MS powerpoint (the cheaper the better, see?), so in the end every key behaves like the keryboard key you would press to do the job (and so u don't need drivers). It turned out that they behave like LEFT, RIGHT, ESCAPE, and RETURN, so in the end it is juast a keyboard with only these 4 keys as I said.
But if u are going to test it you can do it with a normal mouse I'm sure it would work too, i would not like to see you buying something that you can not use later
Good luck, man!
[ Parent | Reply to this comment ]
[ Send Message | View dkg's Scratchpad | View Weblogs ]
So i wrote a little program called mousempc to hook the mouse into mpd. Seems to work fine for me for simple controls: volume up/down, play/pause, next/prev. You'll need libmpd-dev if you want to build it.
With a bit more coding sophistication/keeping track of what buttons are pressed (double-clicks, pressing two buttons simultaneously, click-n-drag, etc), i could probably make the mouse do a lot more (seek/scan, playlist re-organization, etc). I'm not even using the actual mouse pointer info at all yet.
Since this old mouse has a 10 ft. cord, i'm not even sure i want an IR device any more. Thanks for sending me down this path!
The one thing i'm not sure how to handle cleanly is identifying the specific device node for the mouse in the first place (i did it this time with a recursive diff comparison of the /dev/ tree before and after device insertion, but that's a little clumsy).
[ Parent | Reply to this comment ]