Sign in to follow this  
Followers 0
Omala

(NEED HELP) Creative RM-1800 + Automation

18 posts in this topic

#1 ·  Posted (edited)

Hello!

This is my first post and I hope I can get the help of the community to further develop a couple things. I'd like to forewarn anyone who assists me that I am a complete newbie to programming and have very little understanding of how things like this work. I'm a tinkerer. I break things till they work the way I want them to.

I am frustrated along with a very large customer base of Creative's with a controller which is provided with my X-Fi Fatal1ty sound card (RM-1800) and it's lack of functionality with third party software. I'm working with a small program called Automation which uses Autoit for scripting.

So far, this is EXACTLY the combination I'm looking for to provide the result I'm looking for. The scripting here does all the automating scripts necessary to control my computer but I need help developing some more so the buttons will react depending on weather a program is open or not.

So, on to my discussion and I plan on not only sharing this, but spreading it for all the other frustrated users of this particular remote out there. I'm starting with Media Portal as I'd like to turn my computer into a Media Center PC and find that Media Portal provides me with a great base for free software. It basically does everything I need it to do and is customizable as well as open source (yay).

Automation

http://www.glorf.com/rm1800/

RM-1800 Automation

RM-1800 Automation is a free, open source, program under the GPL that can be used to remap the buttons on the Creative RM-1800 remote control that comes with Creative X-Fi sound cards. The program uses code based upon Intelliremote by Andrew Schwartz to read the keypresses and then executes an AutoIt3 script. This program currently requires AutoIt3 to be installed on the same computer to function.

This program is a *BETA* and has not undergone extensive testing. If you find a bug, you can e-mail it to glorfy@gmail.com.

(Update June 15, 2008: I have been personally using this application for months and I love it. I haven't discovered any bugs, and haven't messed with the scripts since it was made. I haven't yet felt the need to make any changes. If there is interest in it, I'll consider making it a bit more user friendly for those who can't figure out AutoIt scripts... e-mail me if you're interested. I'll paste in some of the scripts I'm using for examples below the picture.)

Posted Image

The page also goes on to post sample scripts.

So... On to my questions and I hope I'm going in the right direction. If not, please help lead me!!! I can be led to water.

Resources:

MSDN Virtual Key Codes: http://msdn.microsoft.com/en-us/library/ms645540.aspx

Keyboard Shortcuts for Media Portal(Eventually I'll expand this to other media players) http://www.team-mediaportal.com/manual/Key...ortcuts_General

Navigation (This may not be possible...)

REMOVED... Too much for now...

Some button scripts I've started with (I'd like to stick with some of the ones I have in question):

The power button:

Currently, it only opens media portal. I'd like to eventually have a program selector with this button and select various media players and the buttons to react based on what the focus window is. Some samples or assistance on how to do this efficiently would be awesome. I was going to just open a window with a bunch of shortcuts to programs and hit the "OK/ENter" button which would launch these applications or setup my Window's start menu to be more navigation friendly.

If WinExists("MediaPortal") Then
        WinKill("MediaPortal")
Else
Run("C:\Program Files\Team MediaPortal\MediaPortal\MediaPortal.exe")
EndIf

The "Options" button.

This button sends the F9 key command to Media Portal, which if using a mouse they share the same function. I'd like to have this operate as a right click as it does if Media Portal is open and you're using a mouse. I've tried with Media Portal open to use virtual key codes, but it seems to not work "VK_RBUTTON (0x02) Right mouse button" and may be a limitation in Media Portal navigation.

; Script Start - Add your code below here
Send("{F9}");

-Still need help, Right Click still not working when Media Portal is not active

Various alphabetic keyboard commands.

Here's one of my frustrations and I really don't know what I'm doing wrong here. Right now if you were to press the "U" key on your keyboard, it will send you to the previous folder in Media Portal but if I put in the Send("U") or Send("{U}") it still registers as typing. So.. If I'm browsing folders in my directories and hit this key, it looks for folders or files starting in "U" rather than just using the keyboard shortcut. I'm having this issue with a few buttons and don't understand how to fix it.

Fixed.

The Alphanumeric keys at the bottom:

What I'd like to see!

1 - Starts browsing with all folders starting with numbers in them.

2 (ABC) - Goes to folders/files starting in "A" second hit "B" and so on.

Can someone help me with this basic script:

1. If button is pressed it Sends 1

Send("{1}")

2. If same button is not pressed in 200ms, the script stops.

3. If same button is pressed < 200 ms then backspace is hit and A is sent.

Kinda like texting on a mobile.

Do this with one button, I can figure out how to with the rest.

This is about it for now. I'm planing on keeping this first post updated as I work on this more. I've also invited the author of Automation to come hang out and help in this thread =D.

Regards

Edited by Omala

Share this post


Link to post
Share on other sites



Hello,

I'm the creator of the rm-1800 program. One major limitation you are probably going to find with my program is that each button press is simply calling autoit.exe with a parameter to load a different script depending on the button pressed. This means that each time a button is pressed, a brand new script will be loaded. In order to counter this, you'll need to have your scripts reading and writing data from a file if you want memory to be retained. This method would allow you to save a state and then increment to let it know how many times the button has been pressed. Your ABC button would be possible with this method by incrementing from 65 to 90 and then resetting to 65 again. (65 is decimal for ASCII "A" and 90 is ASCII "Z"). A similar method could be used for the numbers.

As far as the speed and acceleration... I can't really think of a good way to do this. Especially because a new instance of auto-it is run each time, I believe the speed is fairly limited by that. I wanted to use something like AutoItX and have it run a script I had stored in memory instead of calling autoit.exe each time, but I couldn't find any way to achieve it.

Unfortunately, I'm not familiar with media portal, so I'm unsure of its hot keys and how they work.

As for the menu - I would suggest you write an application to do this. I believe it would be entirely possible to write such an application using AutoIt, but I have never really messed with the GUI parts of it. Then, simply call that program to run on a button press and set the other buttons to react accordingly while it is running.

Thanks for the endorsement!

I hope I've helped,

Glorfindel

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Thanks for your fast response. It's pleasing to see developers support and back their software.

As I stated in my first couple lines, I'm a complete newbie and these things you're suggesting sound awesome, but I'm afraid I haven't the foggiest how to do them. With that said... I don't want people to do the work for me, but help point me in the correct direction of which functions are best suited for what I'm trying.

Hello,

I'm the creator of the rm-1800 program. One major limitation you are probably going to find with my program is that each button press is simply calling autoit.exe with a parameter to load a different script depending on the button pressed. This means that each time a button is pressed, a brand new script will be loaded. In order to counter this, you'll need to have your scripts reading and writing data from a file if you want memory to be retained. This method would allow you to save a state and then increment to let it know how many times the button has been pressed. Your ABC button would be possible with this method by incrementing from 65 to 90 and then resetting to 65 again. (65 is decimal for ASCII "A" and 90 is ASCII "Z"). A similar method could be used for the numbers.

As far as the speed and acceleration... I can't really think of a good way to do this. Especially because a new instance of auto-it is run each time, I believe the speed is fairly limited by that. I wanted to use something like AutoItX and have it run a script I had stored in memory instead of calling autoit.exe each time, but I couldn't find any way to achieve it.

Would it be possible (may need to be answered by someone more proficient with autoit) to write a more complex script for the button pressed so that it's stored in memory for a given time? So, if I press one of the navigation keys, it puts sort of a wait here for 1 second to see if I make another command type thing? If this is possible, I'd say that creating some form of a script which would "hit the arrow key" for a certain number of times, if held hit's it for more times...

Something like.. Press button Down is hit once>Script goes to memory but something is still keeping the script active then if the button is pressed and held starts running a further written script which would hit the down key for lets say 3 times for a period of 500 ms, then if that command (button is still being pressed) 6 times for 500 ms and so on.

For the alphanumeric keys, I don't have the slightest clue how to create an incrementing function. If someone could point me in the right direction for which one of these: http://www.autoitscript.com/wiki/Function_list I'd use =D tha'd be great! Or a sample code...

Unfortunately, I'm not familiar with media portal, so I'm unsure of its hot keys and how they work.

I think it's a function argument I'm missing. Something which sends a more specific keystroke command rather then parsing as the letter because when I hit the "U" key on my keyboard it functions as it should. All the Function keys on the keyboard work as intended, just alphabetic keystrokes are giving me the problem.

Yet something I think someone more proficient with Autoit may be able to assist me in.

As for the menu - I would suggest you write an application to do this. I believe it would be entirely possible to write such an application using AutoIt, but I have never really messed with the GUI parts of it. Then, simply call that program to run on a button press and set the other buttons to react accordingly while it is running.

Thanks for the endorsement!

I hope I've helped,

Glorfindel

I think I'll work on the application when I can learn more about Autoit and how to utilize it's functions properly. I've also thought about using another program I've played with in the past called Auto Play Media Studio which I have a full version of. Basically, it was used to create auto launching CDs and provide some very nice interfaces for menu navigation and launching programs. Edited by Omala

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

HA!

Figured out the problem with the key commands not being sent properly.

I needed to use lowercase. :/

Send("{u}", 1);

On another note... Getting this when I press the scroll wheels:

Posted Image

I'll try to write a button script.

Edited by Omala

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Hello Autoit people :P

I need some help with making a script.

I'm trying to program one of those number buttons on the bottom of the remote above so that they input a 2 first, if given an interval it stops the script, if the button is hit again within a "timeout" interval, backspace is hit then A is entered and goes for B and finishes with C. This would be for the "2" key, where the "3" key would be D, E, F.

If someone would help me with the 2,A,B,C button pretty please.

I'm completely programing challenged and any assistance on this would be amazing. I'd show my great appreciation through the form of smilies.

Edited by Omala

Share this post


Link to post
Share on other sites

In response to a post made here: http://www.autoitscript.com/forum/index.ph...st&p=566043

#include <Misc.au3>
AutoItSetOption("WinWaitDelay", 1)
AutoItSetOption("WinTitleMatchMode", 2)

HotKeySet("{DOWN}", "_progressiveDOWN")
HotKeySet("{UP}", "_progressiveUP")

Run("notepad")
WinWait("Notepad")

While 1
    Sleep(1111)
WEnd

Func _progressiveDOWN()
    HotKeySet("{DOWN}")
    $sleepVAR = 1000 ;inital delay
    While _IsPressed(28)
        WinActivate("Notepad")
        Send("DOWN ")
        TrayTip("DOWN", $sleepVAR, 1)
        Sleep($sleepVAR)
        $sleepVAR = $sleepVAR - 100
        If $sleepVAR < 200 Then $sleepVAR = 200 ;max speed
    WEnd
    TrayTip("", "", 1)
    HotKeySet("{DOWN}", "_progressiveDOWN")
EndFunc   ;==>_progressiveDOWN

Func _progressiveUP()
    HotKeySet("{UP}")
    $sleepVAR = 1000 ;inital delay
    While _IsPressed(26)
        WinActivate("Notepad")
        Send("UP ")
        TrayTip("UP", $sleepVAR, 1)
        Sleep($sleepVAR)
        $sleepVAR = $sleepVAR - 100
        If $sleepVAR < 200 Then $sleepVAR = 200 ;max speed
    WEnd
    TrayTip("", "", 1)
    HotKeySet("{UP}", "_progressiveUP")
EndFunc   ;==>_progressiveUP
...but it has problems. By design, the IsPressed function allows the key being pressed to be passed onto the application in focus - this could be a problem for you.

You would replace Send("UP ") with Send("{UP}")


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

The problem with this is that this entire script will be executed each time the button is pressed, unlike a key on the keyboard, there is no way to check if it is still down. The only way I can think of to get it to work, would be to write a file to save the time of the last press and try to treat rapid presses as holding the key down. You might get it to work. You'd want to look at the functions under File, Directory and Disk Management in the AutoIt help file... things like FileOpen, FileRead, FileWrite, etc. Also, you might take a look at the time and date macros (IE: @SEC, @MIN, etc.) and maybe _TimeToTicks (you'll need to #include <Date.au3> to use this) to make comparisons easier.

Share this post


Link to post
Share on other sites

Sorry to double post, but I don't see an edit button.

On Omala's request, I have updated the program to version 1.01 which supports pressing of the center of the scroll wheels on the creative rm-1800 remote control. I've also included an update version so you won't overwrite all your current scripts. Get it at the website: http://www.glorf.com/rm1800/

Enjoy,

Glorfindel

Share this post


Link to post
Share on other sites

In response to a post made here: http://www.autoitscript.com/forum/index.ph...st&p=566043

#include <Misc.au3>
AutoItSetOption("WinWaitDelay", 1)
AutoItSetOption("WinTitleMatchMode", 2)

HotKeySet("{DOWN}", "_progressiveDOWN")
HotKeySet("{UP}", "_progressiveUP")

Run("notepad")
WinWait("Notepad")

While 1
    Sleep(1111)
WEnd

Func _progressiveDOWN()
    HotKeySet("{DOWN}")
    $sleepVAR = 1000 ;inital delay
    While _IsPressed(28)
        WinActivate("Notepad")
        Send("DOWN ")
        TrayTip("DOWN", $sleepVAR, 1)
        Sleep($sleepVAR)
        $sleepVAR = $sleepVAR - 100
        If $sleepVAR < 200 Then $sleepVAR = 200 ;max speed
    WEnd
    TrayTip("", "", 1)
    HotKeySet("{DOWN}", "_progressiveDOWN")
EndFunc   ;==>_progressiveDOWN

Func _progressiveUP()
    HotKeySet("{UP}")
    $sleepVAR = 1000 ;inital delay
    While _IsPressed(26)
        WinActivate("Notepad")
        Send("UP ")
        TrayTip("UP", $sleepVAR, 1)
        Sleep($sleepVAR)
        $sleepVAR = $sleepVAR - 100
        If $sleepVAR < 200 Then $sleepVAR = 200 ;max speed
    WEnd
    TrayTip("", "", 1)
    HotKeySet("{UP}", "_progressiveUP")
EndFunc   ;==>_progressiveUP
...but it has problems. By design, the IsPressed function allows the key being pressed to be passed onto the application in focus - this could be a problem for you.

You would replace Send("UP ") with Send("{UP}")

This is awesome! OK, I'll read up on what all the functions do and try to break...er.. make this work. Thanks so much for your time. as promised:

;) ;) :bye::cheer:^_^:rambo::lmao::idea::D :D

Sorry to double post, but I don't see an edit button.

On Omala's request, I have updated the program to version 1.01 which supports pressing of the center of the scroll wheels on the creative rm-1800 remote control. I've also included an update version so you won't overwrite all your current scripts. Get it at the website: http://www.glorf.com/rm1800/

Enjoy,

Glorfindel

You're amazing. Thanks for keeping on top of this. =D.

(Back to work for me)

I saw some tutorials around here for calling other programs. I want to attempt to retain the functionality of those scrolly deals at the top.

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

The problem with this is that this entire script will be executed each time the button is pressed, unlike a key on the keyboard, there is no way to check if it is still down. The only way I can think of to get it to work, would be to write a file to save the time of the last press and try to treat rapid presses as holding the key down. You might get it to work. You'd want to look at the functions under File, Directory and Disk Management in the AutoIt help file... things like FileOpen, FileRead, FileWrite, etc. Also, you might take a look at the time and date macros (IE: @SEC, @MIN, etc.) and maybe _TimeToTicks (you'll need to #include <Date.au3> to use this) to make comparisons easier.

This here is my exact problem. Since the remote IR signal works in pulses (Seems to be about 150ms) the script needs to have a close script after lets say 200ms. Then a condition if the button is pressed within the 150-200 to continue and get progressively faster.

I'm also thinking that I may need a stop script button on the opposing key. So, if I have the script running on the UP key, I press down and it stops the script.

I'll read on the Functions you mentioned.

I think I've got a good start. Thanks for your help.

Edited by Omala

Share this post


Link to post
Share on other sites

I hate asking for help, but I'm afraid I need it terribly. After going through all of this information, I feel I'm way over my head.

There's too much to absorb. =*(.

My end result will not be for any personal monetary gain. I'm doing this because I'd like to help others who have this controller and are frustrated with the lack of updates from Creative. This controller is the bane of everyone who has purchased from them because the software that comes from Creative is very proprietary and only functions with their software.

Can someone help me with this basic script:

1. If button is pressed it Sends 1

Send("{1}")

2. If same button is not pressed in 200ms, the script stops.

3. If same button is pressed < 200 ms then backspace is hit and A is sent.

Kinda like texting on a mobile.

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

In response to a post made here: http://www.autoitscript.com/forum/index.ph...st&p=566043

#include <Misc.au3>
AutoItSetOption("WinWaitDelay", 1)
AutoItSetOption("WinTitleMatchMode", 2)

HotKeySet("{DOWN}", "_progressiveDOWN")
HotKeySet("{UP}", "_progressiveUP")

Run("notepad")
WinWait("Notepad")

While 1
    Sleep(1111)
WEnd

Func _progressiveDOWN()
    HotKeySet("{DOWN}")
    $sleepVAR = 1000 ;inital delay
    While _IsPressed(28)
        WinActivate("Notepad")
        Send("DOWN ")
        TrayTip("DOWN", $sleepVAR, 1)
        Sleep($sleepVAR)
        $sleepVAR = $sleepVAR - 100
        If $sleepVAR < 200 Then $sleepVAR = 200 ;max speed
    WEnd
    TrayTip("", "", 1)
    HotKeySet("{DOWN}", "_progressiveDOWN")
EndFunc   ;==>_progressiveDOWN

Func _progressiveUP()
    HotKeySet("{UP}")
    $sleepVAR = 1000 ;inital delay
    While _IsPressed(26)
        WinActivate("Notepad")
        Send("UP ")
        TrayTip("UP", $sleepVAR, 1)
        Sleep($sleepVAR)
        $sleepVAR = $sleepVAR - 100
        If $sleepVAR < 200 Then $sleepVAR = 200 ;max speed
    WEnd
    TrayTip("", "", 1)
    HotKeySet("{UP}", "_progressiveUP")
EndFunc   ;==>_progressiveUP
...but it has problems. By design, the IsPressed function allows the key being pressed to be passed onto the application in focus - this could be a problem for you.

You would replace Send("UP ") with Send("{UP}")

http://www.autoitscript.com/forum/index.ph...mp;hl=Singleton

I think I'm getting warmer...

A question maybe someone can answer or help me find (yes, I've been digging).

Can someone provide me with an example of _SingleTon checking for a .au3 script in my taskbar? I've so far only been able to find examples of _SingleTon looking for executables.

Edited by Omala

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

Omala, no offense but at the moment you are way over your head..;) I'm sure you will catch up quite fast if your determined to do so. Especially if you follow this advice. forget rm-1800 for the next two weeks and do this instead.

1: Step through the tutorial section of the help file. (I'm sure you already have). But make sure you understand what each step tries to show you. It's not a tutorial on how to make programs. So just try to understand what the samples achieve.

2: Go to the section Keyword Statement Reference and learn every page by hart. Run every piece of sample code and make sure you understand how it works. Make at least 3 code snippets on your own covering what you learned from the page your studying.

3: Go to the section Function reference/Window management in the autoit help file, and study each Win* function. You will have to know them and understand what they will do for you. Make at least 3 samples on your own for each function! Do not skip this! If the help file don't provide enough information search the forum from the advanced page. Use the function name as your search argument and tick of "Search titles only". Collect the best topic links for each function.

4: Go to the section Function reference/process management and study every function starting with Process* and Run*. Same procedure as in the previous paragraphs.

This seems like a lot of work, and it is. But the way your doing it now is not intelligent and not the fastest to achieve what you want. If you follow this plan, you may PM me with your questions. But you have to prove that you have done your part of the job by breaking your questions down in short concise parts, followed by sample code (does not have to work but it has to be there).

Best of luck

Uten

EDIT: pest is not best

Edited by Uten

Share this post


Link to post
Share on other sites

Uten is right, you do need to spend at least a week or two reviewing the basics of scripting. This is especially true if you aren't familiar with another programming language already. You've gotta walk before you run.

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

Omala, no offense but at the moment you are way over your head..;) I'm sure you will catch up quite fast if your determined to do so. Especially if you follow this advice. forget rm-1800 for the next two weeks and do this instead.

1: Step through the tutorial section of the help file. (I'm sure you already have). But make sure you understand what each step tries to show you. It's not a tutorial on how to make programs. So just try to understand what the samples achieve.

2: Go to the section Keyword Statement Reference and learn every page by hart. Run every piece of sample code and make sure you understand how it works. Make at least 3 code snippets on your own covering what you learned from the page your studying.

3: Go to the section Function reference/Window management in the autoit help file, and study each Win* function. You will have to know them and understand what they will do for you. Make at least 3 samples on your own for each function! Do not skip this! If the help file don't provide enough information search the forum from the advanced page. Use the function name as your search argument and tick of "Search titles only". Collect the best topic links for each function.

4: Go to the section Function reference/process management and study every function starting with Process* and Run*. Same procedure as in the previous paragraphs.

This seems like a lot of work, and it is. But the way your doing it now is not intelligent and not the fastest to achieve what you want. If you follow this plan, you may PM me with your questions. But you have to prove that you have done your part of the job by breaking your questions down in short concise parts, followed by sample code (does not have to work but it has to be there).

Best of luck

Uten

EDIT: pest is not best

By all means, this is the best response to this thread short of the update to the rm-1800 software =D.

I've been looking for a "where to start" and there isn't anything. I've looked at code all day and done searches on this site to see what it does and how it works. So far I'm getting somewhere, but you're absolutely correct... I have no base. Many of the people who come here, already have some form of a language background. What I've found on this site is that this is actually a good place to start if you've never programed. The scripting here is not as complicated and works amazingly for automating tasks. I've made a few small scripts and downloaded the Autoit 1-2-3, but your ideas seem better.

My problem so far has been I had no clue where to start and I think I was looking for a shortcut to a problem I'm already very frustrated with.

Possibly your advice should be stickied.

On following the note of me jumping the gun. A while back a friend of mine linked this to me.

http://norvig.com/21-days.html

I'm thinking I should have listened to my friend =)

Edited by Omala

Share this post


Link to post
Share on other sites

By all means, this is the best response to this thread short of the update to the rm-1800 software =D.

I've been looking for a "where to start" and there isn't anything. I've looked at code all day and done searches on this site to see what it does and how it works. So far I'm getting somewhere, but you're absolutely correct... I have no base. Many of the people who come here, already have some form of a language background. What I've found on this site is that this is actually a good place to start if you've never programed. The scripting here is not as complicated and works amazingly for automating tasks. I've made a few small scripts and downloaded the Autoit 1-2-3, but your ideas seem better.

My problem so far has been I had no clue where to start and I think I was looking for a shortcut to a problem I'm already very frustrated with.

Possibly your advice should be stickied.

On following the note of me jumping the gun. A while back a friend of mine linked this to me.

http://norvig.com/21-days.html

I'm thinking I should have listened to my friend =)

I've found a bug in my update code and will be uploading a fixed copy in a little while... I accidentally left in a couple debugging numbers on play and eject.

Share this post


Link to post
Share on other sites

I've found a bug in my update code and will be uploading a fixed copy in a little while... I accidentally left in a couple debugging numbers on play and eject.

Thanks,

I've been doing reading. I'm getting further and will update this thread soon with some more educated questions.

Share this post


Link to post
Share on other sites

Sorry it took so long, I'm having a bad week. I went ahead and updated the site with just the executable of the fix for the play button bug. Just replace your 1.01 executable with that one and everything should hopefully work correctly. Let me know if you encounter any more bugs.

Thanks,

Glorfindel

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0