Jump to content

Make your own hotkeys!


jaenster
 Share

Recommended Posts

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

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

  • 2 months later...

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...