AutoHotkey Community

It is currently May 27th, 2012, 8:05 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: December 29th, 2006, 1:18 pm 
Hey.
I have a button on my keyboard that says teamspeak, and i want a macro so that when i press this button, it opens up teamspeak and connects to my server automatically.

I would really appriciate it if someone could make this.

Thanks,
Wallace


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 29th, 2006, 1:25 pm 
Quote:
I would really appriciate it if someone could make this
Why not doing it yourself?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 29th, 2006, 5:55 pm 
have a guess... i cant


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 29th, 2006, 9:11 pm 
Because of what reason?

Quote:
If your keyboard or mouse has a key not listed above, you might still be able to make it a hotkey by using the following steps (requires Windows XP/2000/NT or later):

Ensure that at least one script is running that is using the keyboard hook. You can tell if a script has the keyboard hook by opening its main window and selecting "View->Key history" from the menu bar.
Double-click that script's tray icon to open its main window.
Press one of the "mystery keys" on your keyboard.
Select the menu item "View->Key history"
Scroll down to the bottom of the page. Somewhere near the bottom are the key-down and key-up events for your key. NOTE: Some keys do not generate events and thus will not be visible here. If this is the case, you cannot directly make that particular key a hotkey because your keyboard driver or hardware handles it at a level too low for AutoHotkey to access. For possible solutions, see further below.
If your key is detectible, make a note of the 3-digit hexadecimal value in the second column of the list (e.g. 159).
To define this key as a hotkey, follow this example:
SC159:: ; Replace 159 with your key's value.
MsgBox, %A_ThisHotKey% was pressed.
returnReverse direction: To remap some other key to become a "mystery key", follow this example:

; Replace 159 with the value discovered above. Replace FF (if needed) with the
; key's virtual key, which can be discovered in the first column of the Key History screen.
#c::Send {vkFFsc159}Alternate solutions: If your key or mouse button is not detectible by the Key History screen, one of the following might help:

Reconfigure the software that came with your mouse or keyboard (sometimes accessible in the Control Panel or Start Menu) to have the "mystery key" send some other keystroke. Such a keystroke can then be defined as a hotkey in a script. For example, if you configure a mystery key to send Control+F1, you can then indirectly make that key as a hotkey by using ^F1:: in a script.

Try searching the forum or asking for help there. There may be ways to detect certain keys and buttons using techniques such as DllCall, OnMessage, and RegisterRawInputDevices.

The following is a last resort and generally should be attempted only in desperation. This is because the chance of success is low and it may cause unwanted side-effects that are difficult to undo:
Disable or remove any extra software that came with your keyboard or mouse or change its driver to a more standard one such as the one built into the OS. This assumes there is such a driver for your particular keyboard or mouse and that you can live without the features provided by its custom driver and software.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 17th, 2007, 1:03 pm 
Offline

Joined: March 24th, 2006, 4:15 pm
Posts: 20
Well you can experiment with this, it's from a larger script so I hope everything is present and correct.

Code:
TScmd = teamspeak://yourservername.net/?nickname=yournickname   ;
TSexe = TeamSpeak.exe
Pskill = C:\Program Files\pstools\pskill.exe


$^!T::Goto, LaunchTeamSpeak            ; review trigger

LaunchTeamSpeak:                  ; check how to minimise
; http://forum.goteamspeak.com/showthread.php?t=20787&highlight=teamspeak+command+line
; http://forum.goteamspeak.com/archive/index.php/t-827.html
  Process, Exist, %TSexe%,               ;Check if TeamSpeak is alReady Running to not open it Multiple times
  If Errorlevel <> 0
    Run, %Pskill% %TSexe%             
   ;Return
  Else
    Run, %TScmd%
Return


Pskill is part of PsTools and you can get it from http://www.microsoft.com/technet/sysinternals/utilities/pstools.mspx Mind you there are prob other ways you could terminate it. Hope it's useful


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], BrandonHotkey, Google Feedfetcher, just me and 73 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group