Wingens Posted July 22, 2015 Posted July 22, 2015 Hi,I am using ini files wich can set different (variable) key combinations in the script. i have a settings button wich opens a gui where the ini file can be editted and only the key that combines with the CTRL in the HotkeySetBut the problem i have is that the hotkeyset does nothing when i use the variable, when i hardcode a letter to the combination it does work.What am i doing wrong.expandcollapse popup$GUI = GUICreate("Hotkey", 207, 121, -1, -1) $Combo = GUICtrlCreateCombo("", 16, 40, 161, 25, BitOR($CBS_DROPDOWNLIST, $WS_VSCROLL)) If FileExists(@ScriptDir & "\INI\Namen\names.ini") Then $var = IniReadSection(@ScriptDir & "\INI\Namen\names.ini", "Names") If @error <> 1 Then GUICtrlSetData($COMBO, "") For $x = 1 To $var[0][0] GUICtrlSetData($COMBO, $var[$x][0]) Next EndIf EndIf GUICtrlCreateLabel("Naam:", 16, 16) $SETTINGS = GUICtrlCreateButton("Instellingen", 16, 72, 75, 25) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $SETTINGS SETTINGS() Case $GUI_EVENT_CLOSE Exit Case $COMBO SETHOTKEY() EndSwitch WEnd Func SETHOTKEY() $NAME = GUICtrlRead($COMBO) $VARDEFAULT = IniRead(@Scriptdir & "\INI\Namen\" & $NAME & ".ini", "standaard", "Q", "") MsgBox(4096, "Test", $VARDEFAULT) HotKeySet("^" & $VARDEFAULT, "TIMESTAMP") EndFunc ;==================================================================================================================================================================================== Func TIMESTAMP() $NAME = GUICtrlRead($COMBO) $var = IniRead(@ScriptDir & "\names.ini", "names", $NAME, "") ControlSend("", "", "", $var & " | " & @MDAY & "-" & @MON & "-" & @YEAR & " | " & @HOUR & ":" & @MIN & " | ", 0) Sleep(50) EndFunc
JohnOne Posted July 22, 2015 Posted July 22, 2015 Show your ini file. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Wingens Posted July 23, 2015 Author Posted July 23, 2015 [STANDAARD] Q=Q [BEHANDELING] B=B [GEBELD] G=GThis is the ini file
JohnOne Posted July 23, 2015 Posted July 23, 2015 Still not enough to run code, what is the other ini file? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
JohnOne Posted July 23, 2015 Posted July 23, 2015 What are you exactly pressing on physical keyboard to invoke the function? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
JohnOne Posted July 23, 2015 Posted July 23, 2015 It works for me pressing ctrl + shift + q Because of course it is setting the uppercase "Q" AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Wingens Posted July 23, 2015 Author Posted July 23, 2015 Damn, your right i should use lower case only letter in the input variables. thx
Wingens Posted July 23, 2015 Author Posted July 23, 2015 One last question, i am trying to limit the input box to lowercase only with the code: $DEFAULT = GUICtrlCreateInput("", 72, 40, 33, 21, $ES_LOWERCASE)But now i can still type UPPERCASE characters in the input. Any idea's?
JohnOne Posted July 23, 2015 Posted July 23, 2015 Works fine for me...$hGUI = GUICreate("GUI") $hInput = GUICtrlCreateInput("", 10, 10, 200, 20, 0x0010) GUISetState() While GUIGetMsg() <> -3 WEnd AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
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