Skip to content

Commit

Permalink
Add middle mouse button remap
Browse files Browse the repository at this point in the history
  • Loading branch information
justinlin099 committed May 25, 2024
1 parent 87d7170 commit 5d016eb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
9 changes: 7 additions & 2 deletions FrameworkKeyCenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
RICK_ROLL_LOCATION = "C:\Program Files\FrameworkKeyCenter\components\\NGGYU\\NGGYU.exe"
CLIPBOARD_CONTROL_LOCATION = "C:\Program Files\FrameworkKeyCenter\components\CopyandPaste\CopyandPaste.exe"
TRACKPAD_CONTROL_LOCATION = "C:\Program Files\FrameworkKeyCenter\components\TouchPadToggle\TouchPadToggle.exe"
VERSION='Version: 1.0.4'
FRAMEWORK_KEY_SERVICE = "C:\Program Files\FrameworkKeyCenter\components\FrameworkKeyService\FrameworkKeyService.exe"
VERSION='Version: 1.0.5'

current_opaque = 0

Expand Down Expand Up @@ -68,6 +69,8 @@ def apply():
winreg.SetValueEx(key, 'ShellExecute', 0, winreg.REG_SZ, customWeblinkEntry.get())
elif(dropDown.current() == 5):
winreg.SetValueEx(key, 'ShellExecute', 0, winreg.REG_SZ, TRACKPAD_CONTROL_LOCATION)
elif(dropDown.current() == 8):
winreg.SetValueEx(key, 'ShellExecute', 0, winreg.REG_SZ, FRAMEWORK_KEY_SERVICE)

winreg.CloseKey(key)
except FileNotFoundError:
Expand All @@ -89,6 +92,8 @@ def apply():
winreg.SetValueEx(key, 'ShellExecute', 0, winreg.REG_SZ, customWeblinkEntry.get())
elif(dropDown.current() == 5):
winreg.SetValueEx(key, 'ShellExecute', 0, winreg.REG_SZ, TRACKPAD_CONTROL_LOCATION)
elif(dropDown.current() == 8):
winreg.SetValueEx(key, 'ShellExecute', 0, winreg.REG_SZ, FRAMEWORK_KEY_SERVICE)
winreg.CloseKey(key)
else:
print('Switch is off')
Expand Down Expand Up @@ -243,7 +248,7 @@ def opaque_window():
dropDownLabel = ttk.Label(dropDownFrame, text='Select an action', font=('Segoe UI', 10))
dropDownLabel.pack(side='left', padx=10)

dropDown = ttk.Combobox(dropDownFrame, values=['Screen Rotation', 'Copilot Key', 'TaskManager', 'RickRoll', 'Copy and Paste (Clipboard Control)', 'Enable/Disable TrackPad', 'Custom Application', 'Custom Link'], state='readonly')
dropDown = ttk.Combobox(dropDownFrame, values=['Screen Rotation', 'Copilot Key', 'TaskManager', 'RickRoll', 'Copy and Paste (Clipboard Control)', 'Enable/Disable TrackPad', 'Custom Application', 'Custom Link', 'Middle Mouse Button'], state='readonly')
dropDown.pack(side='right', fill='x', expand=True, padx=10)
dropDown.current(0)
dropDown.bind('<<ComboboxSelected>>', selectDropDown)
Expand Down
7 changes: 7 additions & 0 deletions FrameworkKeyService.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import keyboard
import mouse

keyboard.on_press_key(109, lambda x: mouse.press('middle'),suppress=True) # F2
keyboard.on_release_key(109, lambda x: mouse.release('middle'),suppress=True) # F2

keyboard.wait()
4 changes: 3 additions & 1 deletion NSIS.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

Name "Framework Key Center"

OutFile "FrameworkKeyCenterInstaller-v1.0.4.exe"
OutFile "FrameworkKeyCenterInstaller-v1.0.5.exe"

; Request application privileges for Windows Vista and higher
RequestExecutionLevel admin
Expand Down Expand Up @@ -74,6 +74,8 @@ Section "Framework Key Center (required)"

File /r "dist\TouchpadToggle"

File /r "dist\FrameworkKeyService"

AccessControl::GrantOnFile "$INSTDIR\components" "(BU)" "FullAccess"

; Write the installation path into the registry
Expand Down

0 comments on commit 5d016eb

Please sign in to comment.