Welcome Guest.   Make a donation to an author on the site April 24, 2014, 07:03:13 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
The N.A.N.Y. Challenge 2013! Download dozens of custom programs!
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: DONE: howto+script for android phone as 5 action programmable PC remote  (Read 5509 times)
Nod5
Supporting Member
**
Posts: 716



View Profile Give some DonationCredits to this forum member
« on: March 09, 2011, 06:01:57 PM »

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.co...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.
[copy or print]
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:
[copy or print]
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
« Last Edit: March 10, 2011, 12:29:01 PM by Nod5 » Logged
mouser
First Author
Administrator
*****
Posts: 32,701



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: March 09, 2011, 06:07:28 PM »

nice  thumbs up thumbs up
Logged
Deozaan
Charter Member
***
Posts: 6,090



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #2 on: March 09, 2011, 06:09:58 PM »

That's pretty cool!
Logged

Nod5
Supporting Member
**
Posts: 716



View Profile Give some DonationCredits to this forum member
« Reply #3 on: March 10, 2011, 04:32:49 AM »

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.
Logged
Renegade
Charter Member
***
Posts: 10,364



Tell me something you don't know...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #4 on: March 10, 2011, 04:37:28 AM »

That. Looks. Cool!

I gotta try this!
Logged

Slow Down Music - Where I commit thought crimes...

Freedom is the right to be wrong, not the right to do wrong. - John Diefenbaker
Ath
Supporting Member
**
Posts: 2,134



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #5 on: March 10, 2011, 05:28:50 AM »

Hm, I'll try to use/combine this asap with WinButtons thumbs up
Logged

Nod5
Supporting Member
**
Posts: 716



View Profile Give some DonationCredits to this forum member
« Reply #6 on: March 10, 2011, 12:08:51 PM »

I have now also discovered that premotedroid can show screen captures of the PC screen. So if you use it to control an audio player you can move the mouse on the phone to see the playlist window. Very useful!

ath: nice program, WinButtons! I don't think you need my autohotkey script to control WinButtons from premotedroid though. Moving the mouse to the WinButton GUI and then just clicking the buttons should be enough. But it could be smart to write an autohotkey script that locks the mouse within the screen coordinates of the WinButtons window and keeps that window active. That way, you would always have it centered in premotedroid. It would be like having the WinButtons GUI right on the phone, if the GUI is small enough to fit the phone screen.
« Last Edit: March 10, 2011, 12:12:55 PM by Nod5 » Logged
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.039s | Server load: 0.05 ]