Jump to content
Sign in to follow this  
pezo89

Starting a script with a hotkey?

Recommended Posts

pezo89

Hello, i where wondering if it is possible to start a script with a keytouch, like how u can exit a script pressing a keystroke?...

Share this post


Link to post
Share on other sites
Valuater

Another approach...

Welcome to the Forums!

Look up "HotKeySet" in the help file

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
FireFox

@Jos

Could it be possible to make HotKeySet wich key selected works in others apps ?

For example you have :

HotKeySet("s","_none")

Func _none()
;nothing
EndFunc

While 1
WEnd

for me "s" key doesnt work in notepad... :)

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
Valuater

need a sleep() in that loop firefox

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
Jos

Another approach...

Welcome to the Forums!

Look up "HotKeySet" in the help file

8)

Think the OP want to start a script and this would require a script to run already. :o

@Jos

Could it be possible to make HotKeySet wich key selected works in others apps ?

For example you have :

HotKeySet("s","_none")

Func _none()
;nothing
EndFunc

While 1
WEnd

for me "s" key doesnt work in notepad... :)

Cheers, FireFox.

Maybe I am not understanding you correctly but isn;t that what you scripted?

Jos


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
FireFox

@Valuater

... its an example :) just read my problem :o

Edit : @Jos

I mean that after launch script when i go to write something in other apps like notepad, the specified key doesnt work (in my example s key)

Cheers, FireFox.

Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
CodyBarrett

why dont you make a script that runs on startup and have specific hotkeys assigned to it then which hotkey is pressed call that funcition... like you want the .au3 script to run when you hit F5(for example) why dont you make it so the script IS ALREADY running but when you hit f5 it calls th funtions that you want that script to perfrom do you comprehend?

Share this post


Link to post
Share on other sites
iHonda

using hotkeyset you give the script exclusive focus to the key if im correct _IsPressed doesn't not sure though i havnt used it yet


A great place to start Autoit 1-2-3

Share this post


Link to post
Share on other sites
pezo89

well i tend to use it in various games thou, and i assume that the hotkeys on the comp is possible to press "ingame"

Share this post


Link to post
Share on other sites
Valuater

Some games have a program like Game-Guard running and your scripts may not work!

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
herewasplato

sure...put a shortcut to the compiled script on your desktop and assign a "ShortCut Key" to it.

Or if you really want to be brave, you can:

use an au3 file (not compiled)

put that file anywhere on your hard drive that you wish

[well - maybe not the recycle bin :-]

copy the file

paste a shortcut to your desktop

[or somewhere in the start menu folder structure]

right click on that shortcut

select properties from the OS context menu

type one letter into the field named 'Shortcut key"

[for example the letter s]

When you want to start that au3 file/script...

...press ctrl-alt-s

I said brave because using an au3 file instead of a compiled script means that someday, you might update AutoIt to a new version and find that your au3 file no longer works as it had before.

Also, if you decide not to put the shortcut to the au3 file on you desktop, you might have to reboot the computer to get it to register the OS 'Shortcut key", especially if the shortcut that you paste is nested several folders deep in the start folder structure. But putting them all in one place in the start folder structure can keep some clutter off of the desktop.


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

Share this post


Link to post
Share on other sites
herewasplato

... I mean that after launch script when i go to write something in other apps like notepad, the specified key doesnt work (in my example s key) ...

Why is this a surprise to you?

From the help file under HotKeySet:

When you set a hotkey, AutoIt captures the key-press and does not pass it on to the active application, with one exception: the Lock keys (NumLock, CapsLock, and ScrollLock) still toggle their respective state!


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

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  

×