Help with simple repeat key gui keybind script

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
test

Help with simple repeat key gui keybind script

14 Jun 2018, 07:51

Hi guys i'm not a programmer or coder and have a problem which might be simple to u guys.
the script below is meant to use ins to launch
and key in an alphabet, save and after that the alphabet keyed , i'd be able to hold it down and repeat the alphabet

problem is when i launch the program again without reloading script to change hotkey, the previous hotkey would then be unusable

if possible, can i have the previous key be usable without reloading the script?

Code: Select all

ins::
Gui, Destroy

Gui, Add, Text, x17 y8 w120 h20, Turbo Key: 

Gui, Add, Edit, xp yp+30 wp hp vTurbokey, %Turbokey%

Gui, Add, Button, x27 y258 w70 hp gOK, SAVE

Gui, Add, Button, xp+150 yp wp hp gReset, Reset

Gui, Show, x279 y227 h298 w477

Return

Reset: 
Gui, Submit
suspend, off
reload
return

GuiClose: 
Gui, hide
suspend, off
return


OK: 

Gui, Submit, hide
suspend, off
SplashTextOn ,100 ,30 , SAVED, %Turbokey%
sleep 1000
SplashTextOff

Hotkey, %Turbokey%, RemapTurbo 
return

RemapTurbo:
While GetKeyState(Turbokey,"P") 
{
SetKeyDelay, 0, 50
send %Turbokey%
}
return

$a::a
$b::b
$c::c
$d::d
$e::e
$f::f
$g::g
$h::h
$i::i
$j::j
$k::k
$l::l
$m::m
$n::n
$o::o
$p::p
$q::q
$r::r
$s::s
$t::t
$u::u
$v::v
$w::w
$x::x
$y::y
$z::z 
$1::1 
$2::2 
$3::3 
$4::4 
$5::5 
$6::6 
$7::7 
$8::8 
$9::9 
$0::0 
User avatar
evilC
Posts: 4823
Joined: 27 Feb 2014, 12:30

Re: Help with simple repeat key gui keybind script

14 Jun 2018, 13:19

Well, there is a Hotkey GuiControl in AHK, but it's a bit limited, and it doesn't save the settings between runs like you want, or even bind the hotkey that you pressed, you would have to code that yourself
AppFactory has a decent key binding system, and will save settings between runs for you. There's a little bit of a learning curve (You need to use functions), but it's not too hard.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: mikeyww and 380 guests