Jump to content
Sign in to follow this  
jaenster

Make your own hotkeys!

Recommended Posts

jaenster

I made in 20 minutes a program to make your own hotkeys,

Its very short. Use almost none of your cpu.

And it is really easy to install.

Source Code:

#cs
 * ----------------------------------------------------------------------------
 * "THE BEER-WARE LICENSE" (Revision 42):
 * <mail@jaenster.net> wrote this file. As long as you retain this notice you
 * can do whatever you want with this stuff. If we meet some day, and you think
 * this stuff is worth it,o you can buy me a beer in return. Jan Stoots
 * ----------------------------------------------------------------------------
#ce 
Global const $configini = "Config.ini"
$read = IniReadSection($configini,"Hotkeys")
dim $Array[$read[0][0]][2]
for $i = 1 to $read[0][0]    
    $array[$i-1][0] = $read[$i][1]
    $array[$i-1][1] = iniread($configini,"execute",$read[$i][0],"")
    Hotkeyset($array[$i-1][0],"Hotkeys")
next
while 1
    sleep(1000)
wend
Func Hotkeys()
    $hotkey = @HotKeyPressed
    for $I = 0 to ubound($array)-1
        consolewrite($array[$i][1]&@crlf)
        if $hotkey = $array[$i][0] Then run($array[$i][1])
    next
endfunc

Config.ini

[hotkeys]
admincmd=^!a
d2=^!d
Firefox=+^f
[execute]
admincmd=cmd /c runas /noprofile /user:administrator cmd
d2=d:\program files\diablo II\diablo II.exe -w -title 'diablo II' -lq

How do the howkeys work?

^=Ctrl

!=alt

+=shift

#=windowskey

Simple examples hotkeys:

So: what is hotkey !c ? Alt+c

So: what is hotkey +c ? shift+c

So: what is hotkey ^c ? Ctrl+c

So: what is hotkey #c ? Windowskey+c

More complex hotkeys:

^+c = ctrl +shift +c

#^d = windowskey+ctrl+d

I hope you enjoy the script, i know that i do.

Note: The script crashs when it try to open file that dont exit's


-jaenster

Share this post


Link to post
Share on other sites
jaenster

74 views, none with some feedback?


-jaenster

Share this post


Link to post
Share on other sites
Mat

make a GUI which writes the config, that could be quite simple too, just an input that detects key presses and notes them down, or even easier would be a GUI with checkboxes for the control keys and an input for other. That would make a big difference, and shouldn't take you too long!

Share this post


Link to post
Share on other sites
jaenster

make a GUI which writes the config, that could be quite simple too, just an input that detects key presses and notes them down, or even easier would be a GUI with checkboxes for the control keys and an input for other. That would make a big difference, and shouldn't take you too long!

I tryed to do that, but i had no time, I try to work on it soon.. But i got a new version, just some small changes.

On-the-fly update of the hotkeys and that kind of stuff :D


-jaenster

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.