mikeyww wrote: ↑28 Nov 2022, 16:28
I checked your script for a MsgBox command. I did not find a single one.
Code: Select all
CurrentVID = xyz`r
; CurrentVID = xyz
Vv = xyz
equal := CurrentVID = Vv
MsgBox, 64, Result, CurrentVID = %CurrentVID%`n`nVv = %Vv%`n`nEqual = %equal%
Deppest apologies, I forgot to include it since it was not in this script, but a testing one.
Code: Select all
#include <AutoHotInterception>
#SingleInstance Force
#NoEnv
#Persistent
#Warn
#HotkeyInterval 99000000
#MaxHotkeysPerInterval 99000000
#InstallKeybdHook
#MaxMem 256
#Warn UseEnv, Off
#KeyHistory 0
#ErrorStdOut
SetWorkingDir %A_ScriptDir%
SetBatchLines -1
DetectHiddenWindows Off
FileEncoding UTF-16
Process Priority,, High
SetWinDelay -1
SetControlDelay -1
SetKeyDelay -1, -1
SetMouseDelay -1
SetDefaultMouseSpeed 0
ListLines Off
CoordMode, Pixel, Screen
global AHI := new AutoHotInterception()
;=============================================
full_command_line := DllCall("GetCommandLine", "str")
if not (A_IsAdmin or RegExMatch(full_command_line, " /restart(?!\S)"))
{
try
{
if A_IsCompiled
Run *RunAs "%A_ScriptFullPath%" /restart
else
Run *RunAs "%A_AhkPath%" /restart "%A_ScriptFullPath%"
}
ExitApp
}
IniRead,keyVID,%A_ScriptFullPath%:Stream:$DATA, Keyboard, vid
IniRead,keyPID,%A_ScriptFullPath%:Stream:$DATA, Keyboard, pid
if(keyVID == "ERROR" or keyPID == "ERROR")
{
keyVID := "0x03F0"
keyPID := "0x0591"
}
CurrentTap := "a"
;=====================================================
guiwidth := 730
Gui, Color, 808080
Gui, Margin, 0, 0
Gui Font, s8 Norm q0, Ms Shell Dlg 2
Gui, Add, Progress, % "x-1 y-1 w" (guiwidth+2) " h31 Background404040 Disabled hwndHPROG"
Gui Add, Edit, vVID_var x248 y312 w53 h21, %keyVID%
Gui Add, Edit, vPID_var x328 y312 w53 h21, %keyPID%
Gui Add, Button, gUpdate x8 y56 w94 h23, Update
WinSet, Region, 0-0 w730 h30 R30-15
Gui, -Caption
Gui Show, w730 h368, Private Channel V3.2
return
Update:
GuiControlGet,CurrentVID,1:,VID_var
GuiControlGet,CurrentPID,1:,PID_var
Vv := CurrentVID --does not work
Pp := CurrentPID --does not work
;Vv := 0x03F0 --works
;Pp := 0x0591 --works
if(CurrentVID = Vv)
tooltip, equal
else
tooltip, not equal
msgbox, CurrentVID : %CurrentVID% | CurrentPID : %CurrentPID% || Vv : %Vv% | Pp : %Pp%
keyboardId := AHI.GetKeyboardId(Vv, Pp) ;0x03F0, 0x0591
AHI.SendKeyEvent(keyboardId, GetKeySC(CurrentTap), 1)
return