Sign in to follow this  
Followers 0
anca

Inputfile and HotKeySet don't work with @

5 posts in this topic

#1 ·  Posted (edited)

I would send 10 user defined hotkey-values and I use for this the following input.ini - file:

[HKey1]
key=my.email@yahoo.com
[HKey2]
key=contractnummber8829918
[HKey3]
key=ID472995sdf
[HKey4]
key=
[HKey5]
key=
[HKey6]
key=
[HKey7]
key=
[HKey8]
key=
[HKey9]
key=
[HKey0]
key=

The first hotkey don't work with the @ in the emailaddress. If I use this hotkey it sends to the application a wrong character:   my.email²yahoo.com

All other hotkey's are working fine.

What have I to change on my code?

Global $fPaused = False

HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
HotKeySet("+!1", "Msg1") ; Shift-Alt-1
HotKeySet("+!2", "Msg2") ; Shift-Alt-2
HotKeySet("+!3", "Msg3") ; Shift-Alt-3
HotKeySet("+!4", "Msg1") ; Shift-Alt-4
HotKeySet("+!5", "Msg1") ; Shift-Alt-5
HotKeySet("+!6", "Msg1") ; Shift-Alt-6
HotKeySet("+!7", "Msg1") ; Shift-Alt-7
HotKeySet("+!8", "Msg1") ; Shift-Alt-8
HotKeySet("+!9", "Msg1") ; Shift-Alt-9
HotKeySet("+!0", "Msg1") ; Shift-Alt-0

While 1
    Sleep(100)
WEnd

Func TogglePause()
    $fPaused = Not $fPaused
    While $fPaused
        Sleep(100)
        ToolTip('Script is "Paused",  1='& IniRead("input.ini", "HKey1", "key", "value not set!")&' | 2='&IniRead("input.ini", "HKey2", "key", "value not set!")&' | 3='&IniRead("input.ini", "HKey3", "key", "value not set!")&' | 4='&IniRead("input.ini", "HKey4", "key", "value not set!")&' | 5='&IniRead("input.ini", "HKey5", "key", "value not set!")&' | 6='&IniRead("input.ini", "HKey6", "key", "value not set!")&' | 7='&IniRead("input.ini", "HKey7", "key", "value not set!")&' | 8='&IniRead("input.ini", "HKey8", "key", "value not set!")&' | 9='&IniRead("input.ini", "HKey9", "key", "value not set!")&' | 0='&IniRead("input.ini", "HKey0", "key", "value not set!"),0, 0)
    WEnd
    ToolTip("")
EndFunc   ;==>TogglePause

Func Terminate()
    Exit
EndFunc   ;==>Terminate

Func Msg1()
    Send (IniRead("input.ini", "HKey1", "key", "value not set!"))
EndFunc   ;==>ShowMessage
Func Msg2()
    Send (IniRead("input.ini", "HKey2", "key", "value not set!"))
 EndFunc   ;==>ShowMessage
 Func Msg3()
    Send (IniRead("input.ini", "HKey3", "key", "value not set!"))
 EndFunc   ;==>ShowMessage
 Func Msg4()
    Send (IniRead("input.ini", "HKey4", "key", "value not set!"))
 EndFunc   ;==>ShowMessage
 Func Msg5()
    Send (IniRead("input.ini", "HKey5", "key", "value not set!"))
 EndFunc   ;==>ShowMessage
 Func Msg6()
    Send (IniRead("input.ini", "HKey6", "key", "value not set!"))
 EndFunc   ;==>ShowMessage
 Func Msg7()
    Send (IniRead("input.ini", "HKey7", "key", "value not set!"))
 EndFunc   ;==>ShowMessage
 Func Msg8()
    Send (IniRead("input.ini", "HKey8", "key", "value not set!"))
 EndFunc   ;==>ShowMessage
 Func Msg9()
    Send (IniRead("input.ini", "HKey9", "key", "value not set!"))
 EndFunc   ;==>ShowMessage
 Func Msg0()
    Send (IniRead("input.ini", "HKey0", "key", "value not set!"))
EndFunc   ;==>ShowMessage

thx for your help!

Edited by anca

Share this post


Link to post
Share on other sites



Hi anca,

  I tested your code and got a " for the @ so there is soemthing fishy.

I think it must have something to do with the way your pc is saving your ini file.

try this reproducer and see what your results are:

HotKeySet("{F1}", "_iniwrite")
HotKeySet("{F2}", "_iniread")

Global $HostName = "myemail@yahoo.com"

While 1
        Sleep(1000)
WEnd


Func _iniwrite()
IniWrite(@ScriptDir & "\login.ini", "login", "HostName", $HostName)
EndFunc

Func _iniread()
$HostName = IniRead(@ScriptDir & "\login.ini", "login", "HostName", "Default Value")
ConsoleWrite("$HostName =  " & $HostName & @CRLF)
EndFunc

Share this post


Link to post
Share on other sites

Thank you l3ill

With your tip and using the ControlSend function I solved my problem!

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  
Followers 0