QuickSwitch
Snap-Tap on any keyboard Windows/Linux Support
Install / Use
/learn @dotdon/QuickSwitchREADME
QuickSwitch Mode
QuickSwitch Mode is a Python script that enhances keyboard responsiveness for gaming. It allows for near-instant directional changes without needing to lift the initial key pressed, providing a significant advantage in competitive gaming scenarios. Specifically, it prevents both 'a' and 'd' keys from being pressed simultaneously.
Features
- QuickSwitch Mode: Toggle on/off for fast and responsive directional changes.
- Customizable Keys: Easily change the keys used for QuickSwitch.
- GUI: Simple GUI to enable/disable QuickSwitch Mode and display the current status.
Requirements
- Python 3.x
pynputlibrarytkinterlibrary (included with Python's standard library)keyboardlibrary
Installation
- Install Python 3.x from python.org.
- Install the required libraries:
pip install pynput keyboard
Usage
- Clone this repository or download the script.
- Run the script using Python:
python quickswitch.py
Script Overview
Keyboard Listener
The script uses pynput and keyboard to listen for key presses and releases. It toggles QuickSwitch mode when both Ctrl and Shift are pressed simultaneously.
GUI with tkinter
The GUI provides a simple interface with:
- A status label to display whether QuickSwitch mode is enabled or disabled.
- Buttons to manually enable or disable QuickSwitch mode.
Customization
- Custom Keys: Change the
key_aandkey_dvariables to use different keys for QuickSwitch. - Toggle Keys: The script currently uses
CtrlandShiftto toggle QuickSwitch mode. Modify thetoggle_keysset if you want to use different keys.
Code
import tkinter as tk
import keyboard
# Track the state of the keys and mode
quickswitch_enabled = False
key_a_pressed = False
key_d_pressed = False
def on_key_event(e):
global key_a_pressed, key_d_pressed, quickswitch_enabled
if quickswitch_enabled:
if e.name == 'a':
if e.event_type == 'down':
key_a_pressed = True
if key_d_pressed:
keyboard.block_key('d')
elif e.event_type == 'up':
key_a_pressed = False
keyboard.unblock_key('d')
if e.name == 'd':
if e.event_type == 'down':
key_d_pressed = True
if key_a_pressed:
keyboard.block_key('a')
elif e.event_type == 'up':
key_d_pressed = False
keyboard.unblock_key('a')
def update_status():
status_label.config(text=f"QuickSwitch Mode {'Enabled' if quickswitch_enabled else 'Disabled'}")
def enable_quickswitch():
global quickswitch_enabled
quickswitch_enabled = True
update_status()
def disable_quickswitch():
global quickswitch_enabled
quickswitch_enabled = False
update_status()
# Create the GUI
root = tk.Tk()
root.title("QuickSwitch Mode")
status_label = tk.Label(root, text="QuickSwitch Mode Disabled", font=("Times New Roman", 14))
status_label.pack(pady=20)
enable_button = tk.Button(root, text="Enable QuickSwitch", command=enable_quickswitch, font=("Times New Roman", 12))
enable_button.pack(pady=10)
disable_button = tk.Button(root, text="Disable QuickSwitch", command=disable_quickswitch, font=("Times New Roman", 12))
disable_button.pack(pady=10)
# Hook the keyboard events
keyboard.hook(on_key_event)
# Run the GUI event loop
root.mainloop()
# Unhook all keyboard events when the GUI is closed
keyboard.unhook_all()
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Inspired by the concept of "Nullbind" behavior for gaming keyboards.
Related Skills
openhue
345.9kControl Philips Hue lights and scenes via the OpenHue CLI.
sag
345.9kElevenLabs text-to-speech with mac-style say UX.
weather
345.9kGet current weather and forecasts via wttr.in or Open-Meteo
tweakcc
1.6kCustomize Claude Code's system prompts, create custom toolsets, input pattern highlighters, themes/thinking verbs/spinners, customize input box & user message styling, support AGENTS.md, unlock private/unreleased features, and much more. Supports both native/npm installs on all platforms.
