ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Finished Programs

DONE: howto+script for android phone as 5 action programmable PC remote

(1/2) > >>

Nod5:
Hi. I wasn't sure where to post this; it is mostly a howto but includes a small autohotkey script.

A process for using an android phone as a remote control for five autohotkey actions of your choice. I exemplify with remote control of the audio player Xmplay. But the autohotkey commands can be changed to whatever you want to do.

1. install premotedroid on android phone
https://market.android.com/details?id=org.pierre.remotedroid.client
2. install premote server on computer http://code.google.com/p/premotedroid

3. in premotedroid on phone, set up new wifi connection (enter your wifi details)

4. in xmplay > options > shortcuts, create some unusual keyboard combination shortcuts for 5 actions. For example:

(make the shortcuts global)
ctrl+alt+shift+y  -- current track - play pause
ctrl+alt+shift+u  -- change track - prev
ctrl+alt+shift+i  -- change track - next
ctrl+alt+shift+o  -- DSP - vol up
ctrl+alt+shift+p  -- DSP - vol down

5. install the scripting language autohotkey
http://www.autohotkey.com/

6. save the below code as premote.ahk (if you added other shortcuts keys in xmplay then first edit the sendinput code; see http://www.autohotkey.com/docs/commands/Send.htm ). The script, when running, "reroutes" all mouse clicks/scrolls to instead send the xmplay shortcuts keyboard combinations.

--- ---LBUTTON:: sendinput !^+y ;PAUSE
MBUTTON:: sendinput !^+u ;PREV
RBUTTON:: sendinput !^+i ;NEXT
WheelDown:: sendinput !^+o ;VOL DOWN
WheelUp:: sendinput !^+p ;VOL UP
^escape:: exitapp ;control esc to exit
7. run xmplay, turn on wifi, run premotedroid server, run premote.ahk (doubleclick).

Now you can control xmplay with the mouse buttons + scrollbar in the premotedroid app on your phone (scrollbar = right edge of of the screen in premotedroid).

note: to exit script and restore standard mouse button functionality on the computer do ctrl+escape on the computer keyboard. Or ctrl+rightclick the scripts trayicon and ctrl+leftclick "exit".

edit:
For control of Xmplay you can skip step 4 (hotkey setup) by switching to the code below in step 6:

--- ---LBUTTON:: PostMessage 0x41a, 80, 0,, ahk_class XMPLAY-MAIN ;PAUSE
MBUTTON:: PostMessage 0x41a, 129, 0,, ahk_class XMPLAY-MAIN ;PREV
RBUTTON:: PostMessage 0x41a, 128, 0,, ahk_class XMPLAY-MAIN ;NEXT
WheelDown:: PostMessage 0x41a, 513, 0,, ahk_class XMPLAY-MAIN ;VOL DOWN
WheelUp:: PostMessage 0x41a, 512, 0,, ahk_class XMPLAY-MAIN ;VOL UP
^escape::exitapp ;control esc to exit
LBUTTON & WheelUp:: PostMessage 0x41a, 82, 0,, ahk_class XMPLAY-MAIN ;longpress lbutton then scroll up to fast forward in track
LBUTTON & WheelDown:: PostMessage 0x41a, 83, 0,, ahk_class XMPLAY-MAIN ;longpress lbutton then scroll down to rewind in track

mouser:
nice  :up: :up:

Deozaan:
That's pretty cool!

Nod5:
Thanks. I thought up a possible extension too: the premotedroid app on the phone has three mouse buttons and a scroll area. The rest of the screen acts as a mouse touchpad. So mouse gesture actions could also be added. That's more complex but there is mouse gesture code on the autohotkey forums to adapt. If anyone goes for that, feel free to share the solution here.

Renegade:
That. Looks. Cool!

I gotta try this!

Navigation

[0] Message Index

[#] Next page

Go to full version