bolla3 Posted August 3, 2010 Posted August 3, 2010 Hi! Started with AutoIt just some hours ago so please be gentle with me.So here's the deal: I'm writing a program to control a music player. This player uses keyboard shortcuts. This brings me two problems.How to "translate" certain key combinations to another set of keys (e.g alt+up = ctrl+up)What key to use? ctrl, Alt and those keys are used in way to many programs already and would just cause problems.Any suggestions?-bolla3PS: sorry for my broken english. I'm Norwegian
enaiman Posted August 3, 2010 Posted August 3, 2010 Check this online documentation for "Send" http://www.autoitscript.com/autoit3/docs/functions/Send.htmThe same info is available from AutoIt Help file (SciTE -> F1) - use that file often. SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :)
AdmiralAlkex Posted August 3, 2010 Posted August 3, 2010 (edited) Hi and Welcome to the forums!Nice to see a neighbor here, I'm from Sweden (your English seems fine to me).Some general tips:The helpfile for AutoIt is ridiculously good, you can find pretty much anything there so make it your best friend. You can start it by pressing F1 (if you're in SciTE (the editor)) or by opening your start-menu and going to "AutoIt v3\AutoIt Help File".There exists multiple tutorials to help you learn AutoIt, even video ones on Youtube! They are listed in the wiki, here.Now for your questions:1. The easiest would be HotKeySet() and Send(). There is an example in the helpfile for both, as with most functions.Here's a short example that sets Shift+Up as a HotKey and Send's Ctrl+Up#Include <Misc.au3> HotKeySet("!{up}", "_SomeFunc") ;Alt is not a very good key so I use Shift instead (pressing/holding Alt will activate the Menu if one is there, try it in Notepad and you'll see) While 1 Sleep(10) WEnd Func _SomeFunc() Send("^{up}") EndFunc2. Use some other key that you rarely use then? Like Win' or Win|. Let you imagination flow free and I'm sure it can come up with some keys you rarely use. Edited August 3, 2010 by AdmiralAlkex .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
somdcomputerguy Posted August 3, 2010 Posted August 3, 2010 A line like this is basically the same as hitting the 'v' key in the AIMP Music Player, but with the ControlSend command, most apps don't even need to be active..If ProcessExists("AIMP2.exe") Then ControlSend("AIMP2", "", "TAIMPDockSkinFixed1", "v")The AutoIt Window Info Tool (AU3Info) is invaluable.This line will work the same, with both Winamp and AIMP, if this UDF, Winamp Library [on pure AutoIt], is used.If ProcessExists("winamp.exe") Or ProcessExists("AIMP2.exe") Then _Winamp_Stop() - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
bolla3 Posted August 3, 2010 Author Posted August 3, 2010 Ok. I've used the last hours just reading, trying to get a grip on this and, I got an idea! I am thinking about using a keyboard shortcut (alt+shift+Z or something) To open a GUI then send the keyboard shortcuts. Example: The user presses alt+shift+Z And gets a window telling them what song is playing and a list of hotkeys. This will require the window to be open to send keystrokes but, I think it would be easier this way... What do you think? And I know this will make me sound like a moron but, could someone give me an example how to do this? 'cause I have no clue... I'm quite new to programming in general so thanks for all help you have given and will give me
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now