Author: | Philipp Reuter |
Version: | 1.0.0 |
Generated: | Nov 18, 2022 |
Last Update: | Nov 24, 2022 |
Idea based on: | YouTube |
Tested OS: | Windows 11 |
G Mode: | DELL Game Shift |
- Alienware Command Center (AWCC)
- Administrator rights
I had found the GMode.exe from the video and liked the program, but I don't like to use EXE files from untrusted sources, so I wrote a Powershell script that can be run with the run.vbs (Visual Basic Script) with one click.
With both Powershell and Visual Basic Script you can easily read the source code with a text editor, but I still explain each line of code here.
Installation (Video)
- Download ZIP from the green Code Button in the top right.
- Extract the ZIP to any location.
You have two Options, run.vbs to just simulate the key presses and run_manager.vbs to also automaticly manage AWCC, if its not running or crashed.
-
Run the "run.vbs" File.
Presses the Keys to Toggles the G Mode.
-
Run the "run_manager.vbs" File.
➥ Checks if AWCC is running.
➥ Checks if AWCC is installed, if not open a Massage Box to go to the installation webpage.
➥ If AWCC is installed, starts it if its not running.
➥ If AWCC is running, but the process is inactive, terminates the process to trigger a restart of it.
➥ When AWCC is started or restarted, the script waits for special DLLs to be loaded by AWCC.
Before that the key combination is not processed by AWCC and nothing happens!Presses the Keys to Toggles the G Mode.
run.vbs & run_manager.vbs (Visual Basic Script)
current_directory = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".")
➥ Get the current directory.
ps1_script_path = current_directory & "\g_mode.ps1"
➥ Concatenate current directory with file name to get the path to the script.
cmd = "powershell.exe " & ps1_script_path
➥ Define the command to run the script.
CreateObject("Wscript.Shell").Run cmd, 0, True
➥ Run the Script and hide the console.
g_mode.ps1 (Powershell)
Add-Type -MemberDefinition '[DllImport("user32.dll")] public static extern void keybd_event(byte bVk, byte bScan, uint dwFlags,UIntPtr dwExtraInfo);' -name t -namespace w32
➥ Import the "user32.dll" so we can use the keybd_event function.
[w32.t]::keybd_event(0x80,0,0,[UIntPtr]::Zero)
➥ Use the keybd_event function to press Key Code 0x80 (128).
[w32.t]::keybd_event(0x80,0,0x2,[UIntPtr]::Zero)
➥ Use the keybd_event function to release Key Code 0x80 (128).