xkeysnail is yet another keyboard remapping tool for X environment written in Python

Overview

xkeysnail

xkeysnail is yet another keyboard remapping tool for X environment written in Python. It's like xmodmap but allows more flexible remappings.

screenshot

  • Pros
    • Has high-level and flexible remapping mechanisms, such as
      • per-application keybindings can be defined
      • multiple stroke keybindings can be defined such as Ctrl+x Ctrl+c to Ctrl+q
      • not only key remapping but arbitrary commands defined by Python can be bound to a key
    • Runs in low-level layer (evdev and uinput), making remapping work in almost all the places
  • Cons
    • Runs in root-mode (requires sudo)

The key remapping mechanism of xkeysnail is based on pykeymacs (https://github.com/DreaminginCodeZH/pykeymacs).

Installation

Requires root privilege and Python 3.

Ubuntu

sudo apt install python3-pip
sudo pip3 install xkeysnail

# If you plan to compile from source
sudo apt install python3-dev

Fedora

sudo dnf install python3-pip
sudo pip3 install xkeysnail
# Add your user to input group if you don't want to run xkeysnail
# with sudo (log out and log in again to apply group change)
sudo usermod -a -G input $USER

# If you plan to compile from source
sudo dnf install python3-devel

Manjaro/Arch

# Some distros will need to compile evdev components 
# and may fail to do so if gcc is not installed.
sudo pacman -Syy
sudo pacman -S gcc

Solus

# Some distros will need to compile evdev components 
# and may fail to do so if gcc is not installed.
sudo eopkg install gcc
sudo eopkg install -c system.devel

From source

git clone --depth 1 https://github.com/mooz/xkeysnail.git
cd xkeysnail
sudo pip3 install --upgrade .

Usage

sudo xkeysnail config.py

When you encounter the errors like Xlib.error.DisplayConnectionError: Can't connect to display ":0.0": b'No protocol specified\n' , try

xhost +SI:localuser:root
sudo xkeysnail config.py

If you want to specify keyboard devices, use --devices option:

sudo xkeysnail config.py --devices /dev/input/event3 'Topre Corporation HHKB Professional'

If you have hot-plugging keyboards, use --watch option.

If you want to suppress output of key events, use -q / --quiet option especially when running as a daemon.

How to prepare config.py?

(If you just need Emacs-like keybindings, consider to use example/config.py, which contains Emacs-like keybindings).

Configuration file is a Python script that consists of several keymaps defined by define_keymap(condition, mappings, name)

define_keymap(condition, mappings, name)

Defines a keymap consists of mappings, which is activated when the condition is satisfied.

Argument condition specifies the condition of activating the mappings on an application and takes one of the following forms:

  • Regular expression (e.g., re.compile("YYY"))
    • Activates the mappings if the pattern YYY matches the WM_CLASS of the application.
    • Case Insensitivity matching against WM_CLASS via re.IGNORECASE (e.g. re.compile('Gnome-terminal', re.IGNORECASE))
  • lambda wm_class: some_condition(wm_class)
    • Activates the mappings if the WM_CLASS of the application satisfies the condition specified by the lambda function.
    • Case Insensitivity matching via casefold() or lambda wm_class: wm_class.casefold() (see example below to see how to compare to a list of names)
  • None: Refers to no condition. None-specified keymap will be a global keymap and is always enabled.

Argument mappings is a dictionary in the form of {key: command, key2: command2, ...} where key and command take following forms:

  • key: Key to override specified by K("YYY")
  • command: one of the followings
    • K("YYY"): Dispatch custom key to the application.
    • [command1, command2, ...]: Execute commands sequentially.
    • { ... }: Sub-keymap. Used to define multiple stroke keybindings. See multiple stroke keys for details.
    • pass_through_key: Pass through key to the application. Useful to override the global mappings behavior on certain applications.
    • escape_next_key: Escape next key.
    • Arbitrary function: The function is executed and the returned value is used as a command.
      • Can be used to invoke UNIX commands.

Argument name specifies the keymap name. This is an optional argument.

Key Specification

Key specification in a keymap is in a form of K("( -)* ") where

is one of the followings

  • C or Ctrl -> Control key
  • M or Alt -> Alt key
  • Shift -> Shift key
  • Super or Win -> Super/Windows key

You can specify left/right modifiers by adding any one of prefixes L/R.

And is a key whose name is defined in key.py.

Here is a list of key specification examples:

  • K("C-M-j"): Ctrl + Alt + j
  • K("Ctrl-m"): Ctrl + m
  • K("Win-o"): Super/Windows + o
  • K("M-Shift-comma"): Alt + Shift + comma (= Alt + >)

Multiple stroke keys

When you needs multiple stroke keys, define nested keymap. For example, the following example remaps C-x C-c to C-q.

define_keymap(None, {
    K("C-x"): {
      K("C-c"): K("C-q"),
      K("C-f"): K("C-q"),
    }
})

Checking an application's WM_CLASS with xprop

To check WM_CLASS of the application you want to have custom keymap, use xprop command:

xprop WM_CLASS

and then click the application. xprop tells WM_CLASS of the application as follows.

WM_CLASS(STRING) = "Navigator", "Firefox"

Use the second value (in this case Firefox) as the WM_CLASS value in your config.py.

Example config.py

See example/config.py.

Here is an excerpt of example/config.py.

from xkeysnail.transform import *

define_keymap(re.compile("Firefox|Google-chrome"), {
    # Ctrl+Alt+j/k to switch next/previous tab
    K("C-M-j"): K("C-TAB"),
    K("C-M-k"): K("C-Shift-TAB"),
}, "Firefox and Chrome")

define_keymap(re.compile("Zeal"), {
    # Ctrl+s to focus search area
    K("C-s"): K("C-k"),
}, "Zeal")

define_keymap(lambda wm_class: wm_class not in ("Emacs", "URxvt"), {
    # Cancel
    K("C-g"): [K("esc"), set_mark(False)],
    # Escape
    K("C-q"): escape_next_key,
    # C-x YYY
    K("C-x"): {
        # C-x h (select all)
        K("h"): [K("C-home"), K("C-a"), set_mark(True)],
        # C-x C-f (open)
        K("C-f"): K("C-o"),
        # C-x C-s (save)
        K("C-s"): K("C-s"),
        # C-x k (kill tab)
        K("k"): K("C-f4"),
        # C-x C-c (exit)
        K("C-c"): K("M-f4"),
        # cancel
        K("C-g"): pass_through_key,
        # C-x u (undo)
        K("u"): [K("C-z"), set_mark(False)],
    }
}, "Emacs-like keys")

Example of Case Insensitivity Matching

terminals = ["gnome-terminal","konsole","io.elementary.terminal","sakura"]
terminals = [term.casefold() for term in terminals]
termStr = "|".join(str(x) for x in terminals)

# [Conditional modmap] Change modifier keys in certain applications
define_conditional_modmap(lambda wm_class: wm_class.casefold() not in terminals,{
    # Default Mac/Win
    Key.LEFT_ALT: Key.RIGHT_CTRL,   # WinMac
    Key.LEFT_META: Key.LEFT_ALT,    # WinMac
    Key.LEFT_CTRL: Key.LEFT_META,   # WinMac
    Key.RIGHT_ALT: Key.RIGHT_CTRL,  # WinMac
    Key.RIGHT_META: Key.RIGHT_ALT,  # WinMac
    Key.RIGHT_CTRL: Key.RIGHT_META, # WinMac
})

# [Conditional modmap] Change modifier keys in certain applications
define_conditional_modmap(re.compile(termStr, re.IGNORECASE), {

    # Default Mac/Win
    Key.LEFT_ALT: Key.RIGHT_CTRL,   # WinMac
    Key.LEFT_META: Key.LEFT_ALT,    # WinMac
    Key.LEFT_CTRL: Key.LEFT_CTRL,   # WinMac
    Key.RIGHT_ALT: Key.RIGHT_CTRL,  # WinMac
    Key.RIGHT_META: Key.RIGHT_ALT,  # WinMac
    Key.RIGHT_CTRL: Key.LEFT_CTRL,  # WinMac
})

FAQ

How do I fix Firefox capturing Alt before xkeysnail?

In the Firefox location bar, go to about:config, search for ui.key.menuAccessKeyFocuses, and set the Value to false.

License

xkeysnail is distributed under GPL.

xkeysnail
Copyright (C) 2018 Masafumi Oyamada

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see 
   
   .

xkeysnail is based on pykeymacs (https://github.com/DreaminginCodeZH/pykeymacs), which is distributed under GPL.

pykeymacs
Copyright (C) 2015 Zhang Hai

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see 
   
   .
Comments
  • Sending modifier key by itself on output side of K function?

    Sending modifier key by itself on output side of K function?

    I've got an application with an unusual keyboard shortcut structure (ONLYOFFICE Desktop Editors). It wants the user to hit the Alt key, then type the appropriate letter from a bunch of yellow tooltips that appear on the window. This is a distinct sequence of separate keystrokes rather than a typical shortcut "combo". You have to release the Alt key before typing the shortcut letter. If you try to do it as a combo nothing happens.

    Problem is, it seems to be impossible to get xkeysnail to send a modifier key by itself as part of the output side of a K remap function.

    I can sort of understand the issues with allowing the user to remap a single modifier key with no other keystroke on the input side of the K function. That would fundamentally mess with how the keyboard works. But I'm just trying to send out the Alt key keystroke as part of a macro on the output side of the K function. I can't think of any good reason for that not to be allowed.

    When I try to use "M" or "Alt" or "Shift-M" without some non-modifier key added within the quotes, xkeysnail either crashes with an attribute error or simply sends the letter "M" or "m" to the app, rather than the desired modifier key (Alt).

    I did try to use things like "LM" or "RM" so that it wouldn't just send the letter "M", but those produced errors also.

    Is there any way to overcome this problem and do this sequence as an output remap, or will xkeysnail need to be patched to let something like this work?

        K("RC-comma"): [K("M"),K("c"),K("Up"),K("Enter")],       # Open Preferences (Advanced Settings)
    

    "Alt", then the letter "c", then "Up", then "Enter", is what it should do.

    opened by RedBearAK 33
  • Triggering two keybindings in sequence without fully releasing the first one

    Triggering two keybindings in sequence without fully releasing the first one

    I have the following shortcuts:

    M-shift-RIGHT_BRACE
    C-M-n
    

    Let's say I press down the first keybinding.

    To trigger the second keybinding immediately after the first one, I would preserve the modifiers of the first keybinding but release the Shift key and press down the Control key (while keeping Alt pressed down).

    Unfortunately, that doesn't work. The only way to register the second keybinding is to fully release the modifiers of the first keybinding, and then press the second keybinding.

    Is there a workaround to make this use case work?

    Thank you for this awesome software. It was a long journey before discovering it, and surprisingly most of the Emacs config.py works so well for my needs, and it even remaps return to control correctly :smiley:

    opened by thiagoa 17
  • Breaking changes of mod key release in xkeysnail 0.3.0

    Breaking changes of mod key release in xkeysnail 0.3.0

    Breaking changes in xkeysnail 0.3.0.

    The behavior is very different when you operate the keyboard in the following order.

    press Ctrl
    press Alt
    release Ctrl
    press W
    

    xkeysnail 0.2.0: perform Alt-w xkeysnail 0.3.0: perform w

    This behavior is especially problematic when you are operating Emacs. I perform C-SPCC-eM-w. When performing an operation such as, I have to be careful not to release the Ctrl key before hitting the Alt key but w will be typed.

    I think this breaking change because Release mapped modifiers after the original is released. closes #70. by rbreaves - Pull Request #71 - mooz/xkeysnail I'm not sure why this change was necessary in the first place when I look at the issue.

    I'd like to ask @rbreaves what his intentions were in making the change to fix the disruptive change while maintaining the significance of the change.


    original strings

    xkeysnail 0.3.0の破壊的変更について.

    以下の順にキーボードを操作したとき動作が大きく異なります.

    press Ctrl
    press Alt
    release Ctrl
    press w
    

    xkeysnail 0.2.0: perform Alt-w xkeysnail 0.3.0: perform w

    この動作は特にEmacsを操作している時に問題になります. C-SPCC-eM-w のような操作をした時に, Altキーを押す前にCtrlキーを離さないように慎重に気をつけないとwが入力されてしまいます.

    私はこの破壊的変更が Release mapped modifiers after the original is released. Closes #70. by rbreaves · Pull Request #71 · mooz/xkeysnail によって引き起こされたと思っていますが, そもそもこの変更が何故必要だったのかissueを見てもよく分かりませんでした.

    この変更の意義を保ったまま破壊的変更を修正するために @rbreaves に変更の意図を聞きたいです.

    opened by ncaq 14
  • Long press trigger key of multiple stroke keys

    Long press trigger key of multiple stroke keys

    import re
    from xkeysnail.transform import *
    
    # define timeout for multipurpose_modmap
    define_timeout(1)
    
    define_keymap(None, {
        K('SEMICOLON'): {
            K('q'): Key.KEY_0,
            K('w'): Key.KEY_1,
            K('e'): Key.KEY_2,
            K('r'): Key.KEY_3,
            K('t'): Key.KEY_4,
        },
    })
    

    When I long press ; then type qwert in sequence, I expect the out to be 01234 but the real out is 0wert.

    xkeysnail version is v0.4.0 OS: Arch Linux x86_64 Kernel: 5.18.3-arch1-1

    opened by Ynjxsjmh 11
  • Feature: Ability to use Numlock status to limit numpad key remapping

    Feature: Ability to use Numlock status to limit numpad key remapping

    I needed to remap the base numeric keypad navigation/cursor key functions, but found that xkeysnail doesn't have the ability to use the on/off status of Numlock to avoid also remapping the number functions. So remapping the base numeric keypad keys without any modifiers makes the keypad useless as a number pad.

    If Numlock is "on" and the keypad is producing numbers, I don't want to remap the keypad keys in that state. But if Numlock is "off" I want to remap the keypad-specific PgUp/PgDn/Home/End and arrow key codes to their non-keypad counterparts. This is currently not possible, since xkeysnail doesn't appear to register the state of Numlock.

    There needs to be a way to incorporate Numlock status into the key mapping function.

    A new modifier keyword could be added, like "NP_On"/"NP_Off" (Numpad on, numpad off).

    Or, alternately, the existing numeric keypad key definitions could have separate "Numlock off" counterparts, using the same key code but different names, that force xkeysnail to check that Numlock status is "off" before remapping the key.

    These keypad keys are already defined in key.py:

        KPASTERISK = 55
    
        KP7 = 71
        KP8 = 72
        KP9 = 73
        KPMINUS = 74
        KP4 = 75
        KP5 = 76
        KP6 = 77
        KPPLUS = 78
        KP1 = 79
        KP2 = 80
        KP3 = 81
        KP0 = 82
        KPDOT = 83
    
        KPJPCOMMA = 95
        KPENTER = 96
    
        KPSLASH = 98
    
        KPEQUAL = 117
        KPPLUSMINUS = 118
    
        KPCOMMA = 121
    
        KPLEFTPAREN = 179
        KPRIGHTPAREN = 180
    
    

    Something like the lines below could be added to key.py, in addition to the lines above. Same order, same keys, but named with their "Numlock off" functions, with "_NLOFF" added to symbol keys (and 5 key, which has no common alternate function) just to distinguish them from the corresponding numeric Numlock "on" function of the same key. In this way, with an appropriate function added to xkeysnail, all of the numeric keypad keys could be remapped when Numlock is off without interfering with the ability to use the numpad as an actual numeric keypad when Numlock is on.

        KPASTERISK_NLOFF = 55
    
        KP7_HOME = 71
        KP8_UP = 72
        KP9_PAGE_UP = 73
        KPMINUS_NLOFF = 74
        KP4_LEFT = 75
        KP5_NLOFF = 76 
        KP6_RIGHT = 77
        KPPLUS_NLOFF = 78
        KP1_END = 79
        KP2_DOWN = 80
        KP3_PAGE_DOWN = 81
        KP0_INSERT = 82
        KPDOT_NLOFF = 83
    
        KPJPCOMMA_NLOFF = 95
        KPENTER_NLOFF = 96
    
        KPSLASH_NLOFF = 98
    
        KPEQUAL_NLOFF = 117
        KPPLUSMINUS_NLOFF = 118
    
        KPCOMMA_NLOFF = 121
    
        KPLEFTPAREN_NLOFF = 179
        KPRIGHTPAREN_NLOFF = 180
    
    

    Alternate naming possibility, a prefix of "NLO_" for "Numlock off", and no alternate function names added:

        NLO_KPASTERISK = 55
    
        NLO_KP7 = 71
        NLO_KP8 = 72
        NLO_KP9 = 73
        NLO_KPMINUS = 74
        NLO_KP4 = 75
        NLO_KP5 = 76 
        NLO_KP6 = 77
        NLO_KPPLUS = 78
        NLO_KP1 = 79
        NLO_KP2 = 80
        NLO_KP3 = 81
        NLO_KP0 = 82
        NLO_KPDOT = 83
    
        NLO_KPJPCOMMA = 95
        NLO_KPENTER = 96
    
        NLO_KPSLASH = 98
    
        NLO_KPEQUAL = 117
        NLO_KPPLUSMINUS = 118
    
        NLO_KPCOMMA = 121
    
        NLO_KPLEFTPAREN = 179
        NLO_KPRIGHTPAREN = 180
    
    
    opened by RedBearAK 11
  • Firefox captures alt before xkeysnail

    Firefox captures alt before xkeysnail

    When trying to get emacs like key bindings in firefox the alt key is captured by firefox before xkeysnail. What follows is that every time you try to give (M-_) command the Firefox opens up some sort of file options menu and commands are lost in that.

    Users should be informed this will happen because with this I can't really use xkeysnail for the main thing I wanted it for. I have run into this issue before with autohotkey on windows for example but I thought it might work under linux.

    opened by EskoJTH 11
  • Question: Plain key remapping (without modifiers)

    Question: Plain key remapping (without modifiers)

    @luizoti @rbreaves

    Is anyone using the library for that that you're aware of? IE, to remap QWERTY to DVORAK or something weird...

    Or if so could we consider that an edge case? Right now just to type a single character (like "d") with no keymapping at all requires a TON of work, finding keymaps, talking to the window manager, etc... it pegs my CPU at 15% just to hold down a key... (I have fast repeats)

    It seems perhaps if no modifier is held we could just pass the keys straight thru to the output without all that effort for a much smoother pipeline?

    opened by joshgoebel 8
  • PRINT key not working in Modmap

    PRINT key not working in Modmap

    First of all thanks for the amazing package, it literally feels like using Emacs everywhere. Specially due to the mark-setting commands.

    The problem that I'm experiencing is that mapping the PRINT key to any other key doesn't work, as in:

    define_modmap({
        Key.PRINT: Key.RIGHT_ALT,
    })
    

    I've tried mapping it to other keys but still doesn't work. Also, I've successfully mapped other keys using the same method (e.g. RightAlt to RightCtrl).

    I've tested with two different keyboards: the built-in from the Thinkpad T14s and an external Bluetooth Thinkpad keyboard.

    Thanks a lot

    opened by DidacGit 6
  • Avoid releasing keys that were never considered pressed by the system

    Avoid releasing keys that were never considered pressed by the system

    This is two commits to fix two similar issues with RELEASE being set for keys that were never pressed as far as the system is concerned. For modifiers, this was causing issues setting shortcuts in VS Code and triggering IntelliJ's double-tap modifier shortcuts. For other keys I did not run into any problems caused by this, but it seemed inappropriate.

    opened by kevinslashslash 6
  • Seeking working launch() and arbitrary (python) command examples

    Seeking working launch() and arbitrary (python) command examples

    The example config.py has this line, but it doesn't seem to work as expected:

        K("C-o"): [K("C-a"), K("C-c"), launch(["gedit"]), sleep(0.5), K("C-v")]
    

    I just noticed a strange phenomenon when I run xkeysnail with a script in a terminal, this line in my config causes the startup to pause for 5 seconds (this needs import time):

        K("RC-Shift-M-l"):      [launch(["gedit"]), time.sleep(5), K("Enter"), K("t"), K("e"), K("x"), K("t"), K("Enter")],
    

    So it's like the time.sleep(5) function in this example is actually running once during the startup of xkeysnail, rather than running when I trigger the shortcut.

    If I change it to this:

        K("RC-Shift-M-l"):      [time.sleep(5), K("Enter"), K("t"), K("e"), K("x"), K("t"), K("Enter")],
    

    This will just instantly insert [Enter, "text", Enter] into an app like Gedit. It's as if the time.sleep(5) isn't even there inside the macro.

    I also can't get anything to happen after a launch() command, if I try to use it in a multi-keystroke macro, like in the config.py example. The line below will just launch Gedit and then do nothing else. No insertion of characters.

        K("RC-Shift-M-l"):      [launch(["gedit"]), K("Enter"), K("t"), K("e"), K("x"), K("t"), K("Enter")],
    

    Adding the time.sleep() function, since it is being ignored (or executed in a different context?), doesn't do anything different. The only thing that happens is the Gedit launch:

        K("RC-Shift-M-l"):      [launch(["gedit"]), time.sleep(5), K("Enter"), K("t"), K("e"), K("x"), K("t"), K("Enter")],
    

    Putting another launch() command after the first one results in only the first one working and nothing else:

        K("RC-Shift-M-l"):      [launch(["gedit"]), launch(["transmission"]), time.sleep(5), K("Enter"), K("t"), K("e"), K("x"), K("t"), K("Enter")],
    

    Anybody have working examples of other launch() commands, especially in a macro with other things after it, or examples of running arbitrary python commands successfully?

    @mooz @rbreaves @Lenbok

    opened by RedBearAK 5
  • Don't expose uinput device as joystick

    Don't expose uinput device as joystick

    I use Fedora 32 with sway wayland wm. After recent libinput update (from 1.15.4 to 1.15.902) my keyboard stopped working, unless I disabled xkeysnail.

    libinput is used by sway and all most popular wayland compositors. It always had logic to ignore joysticks, but due to a bug the joystick check didn't work correctly. It was fixed recently. Unfortunately, xkeysnail uinput device is detected as joystick by udev and as a result xkeysnail events are ignored by latest libinput:

    $ udevadm info /dev/input/event20
    P: /devices/virtual/input/input23/event20
    N: input/event20
    L: 0
    E: DEVPATH=/devices/virtual/input/input23/event20
    E: DEVNAME=/dev/input/event20
    E: MAJOR=13
    E: MINOR=84
    E: SUBSYSTEM=input
    E: USEC_INITIALIZED=55911717
    E: ID_INPUT=1
    E: ID_INPUT_JOYSTICK=1
    E: ID_INPUT_KEY=1
    E: ID_INPUT_KEYBOARD=1
    E: ID_SERIAL=noserial
    E: LIBINPUT_DEVICE_GROUP=0/0/0:py-evdev-uinput
    E: TAGS=:seat:power-switch:uaccess:
    

    (note ID_INPUT_JOYSTICK).

    Udev's joystick detection seems to rely on checking which events are requested during uinput device setup. I noticed almost all BTN_ events trigger joystick tag, so as a fix I disabled them all in xkeysnail - but only if wayland compositor is present.

    opened by mbachry 5
  • Window Switcher Preview (Super+Tab) broken in `v0.4.0`

    Window Switcher Preview (Super+Tab) broken in `v0.4.0`

    Overview

    When upgrading from v0.3.0 -> v0.4.0, the window switcher preview no longer works when switching applications with Super+Tab (Alt+Tab).

    I am running Ubuntu 20.04 LTS (Focal)

    Expected Behavior

    Notice on v0.3.0 when switching applications, you can see the window switcher displayed. Importantly, it lets you switch to "distant" applications by holding down Super/Alt and hitting Tab multiple times.

    Actual (Broken) Behavior

    After updating to v0.4.0, the switcher no longer pops up. It immediately just switches to the "next" application, which means you can only toggle back and forth between the current and most recent application.

    Source

    The breaking change occurred somewhere between 0.3.0 and 0.4.0

    https://github.com/mooz/xkeysnail/compare/51c369084e0045a8410d227bab52411bf84fb65b...bf3c93b4fe6efd42893db4e6588e5ef1c4909cfb

    Thanks

    Also, I want to take a moment to thank all the maintainers of this project. This tool is incredibly useful and makes mapping keys incredibly easy.

    The community really appreciates everyone who has taken time to contribute to this.

    opened by abhchand 2
  • Where is the config.py supposed to be?

    Where is the config.py supposed to be?

    This is my third time trying to install xkeysnail and I still have issues with the location of config.py

    I'm now on Pop OS 22.04. I've followed the steps for the install and when I get to the part of "sudo xkeysnail config.py" I get a traceback error that ends in "no such file"

    Traceback (most recent call last): File "/usr/local/bin/xkeysnail", line 6, in cli_main() File "/usr/local/lib/python3.10/dist-packages/xkeysnail/init.py", line 61, in cli_main eval_file(args.config) File "/usr/local/lib/python3.10/dist-packages/xkeysnail/init.py", line 5, in eval_file with open(path, "rb") as file: FileNotFoundError: [Errno 2] No such file or directory: 'config.py'

    I've since downloaded the example config.py and placed it on "/usr/local/lib/python3.10/dist-packages/xkeysnail" to no effect. Where should I place it?

    My keyboard is a Logitech MX Keys, I've followed the steps to make it detectable as recommended on issue 151.

    opened by soype 2
  • No such file or directory

    No such file or directory

    I'm on Manjaro and I installed xkeysnail via yay (yay -S xkeysnail).

    The app seems to be installed as I can run it from the terminal but I always get this message which leads me to believe maybe my install didn't go as planned?

    Running with sudo:

    Traceback (most recent call last): File "/usr/bin/xkeysnail", line 6, in cli_main() File "/usr/lib/python3.10/site-packages/xkeysnail/init.py", line 62, in cli_main eval_file(args.config) File "/usr/lib/python3.10/site-packages/xkeysnail/init.py", line 5, in eval_file with open(path, "rb") as file: FileNotFoundError: [Errno 2] No such file or directory: '/root/.config/xkeysnail/config.py'

    Without sudo

    Traceback (most recent call last): File "/usr/bin/xkeysnail", line 6, in cli_main() File "/usr/lib/python3.10/site-packages/xkeysnail/init.py", line 62, in cli_main eval_file(args.config) File "/usr/lib/python3.10/site-packages/xkeysnail/init.py", line 5, in eval_file with open(path, "rb") as file: FileNotFoundError: [Errno 2] No such file or directory: '/home/pedroh/.config/xkeysnail/config.py'

    opened by soype 5
  • c-h and xcape control as esc conflict

    c-h and xcape control as esc conflict

    My setup: 1 use xkeysnail to swap capslock and left contrl define_modmap({ Key.CAPSLOCK: Key.LEFT_CTRL }) 2 use xcape to make a single press on capslock become esc xcape -e 'Control_L=Escape' 3 use xkeysnail to map "c-h" as "BACKSPACE" K("C-h"): K("BACKSPACE"),

    Issue: even "c-h" is mapped as "BACKSPACE", it also triggers a "esc" as "control" is also somehow sent by xkeysnail.

    Workaround: I use left shift as esc at the moment: xcape -e 'Shift_L=Escape'

    Question: why is xkeysnail still sends another single "control" when "c-h" is already mapped to "backspace"? I think this is a bug. Anyway, really thanks for this project, xkeysnail really helps me for my transition to linux from macOS

    opened by popeliao 3
  • key.py is too young too simple, Need a more detailed key comparison table .

    key.py is too young too simple, Need a more detailed key comparison table .

    Many key names are not stated and don't know what they are for example menu is not menu on the keyboard, but i dont't know that key call what in key.py

    opened by lowy 4
Owner
Masafumi Oyamada
Masafumi Oyamada
This repository uses a mixture of numbers, alphabets, and other symbols found on the computer keyboard

This repository uses a mixture of numbers, alphabets, and other symbols found on the computer keyboard to form a 16-character password which is unpredictable and cannot easily be memorised.

Mohammad Shaad Shaikh 1 Nov 23, 2021
Keystroke logging, often referred to as keylogging or keyboard capturing

Keystroke logging, often referred to as keylogging or keyboard capturing, is the action of recording the keys struck on a keyboard, typically covertly, so that a person using the keyboard is unaware that their actions are being monitored.

Harsha G 2 Jan 11, 2022
PySharpSphere - Inspired by SharpSphere, just another python version

PySharpSphere Inspired by SharpSphere, just another python version. Installation python3 setup.py install Features Support control both Linux and Wind

Ricter Zheng 191 Dec 22, 2022
Phoenix Framework is an environment for writing, testing and using exploit code.

Phoenix Framework is an environment for writing, testing and using exploit code. ?? Screenshots ?? Community PwnWiki Forums ?? Licen

null 42 Aug 9, 2022
EMBArk - The firmware security scanning environment

Embark is being developed to provide the firmware security analyzer emba as a containerized service and to ease accessibility to emba regardless of system and operating system.

emba 175 Dec 14, 2022
Phoenix Framework is an environment for writing, testing and using exploit code.

Phoenix-Framework Phoenix Framework is an environment for writing, testing and using exploit code. ?? Screenshots ?? Community PwnWiki Forums ?? Licen

Felix 42 Aug 9, 2022
Log4j rce test environment and poc

log4jpwn log4j rce test environment See: https://www.lunasec.io/docs/blog/log4j-zero-day/ Experiments to trigger in various software products mentione

Leon Jacobs 307 Dec 24, 2022
A Fast Broken Link Hijacker Tool written in Python

Broken Link Hijacker BrokenLinkHijacker(BLH) is a Fast Broken Link Hijacker Tool written in Python.

Mayank Pandey 70 Nov 30, 2022
Pupy is an opensource, cross-platform (Windows, Linux, OSX, Android) remote administration and post-exploitation tool mainly written in python

Pupy Installation Installation instructions are on the wiki, in addition to all other documentation. For maximum compatibility, it is recommended to u

null 7.4k Jan 4, 2023
A forensic collection tool written in Python.

CHIRP A forensic collection tool written in Python. Watch the video overview ?? Table of Contents ?? Table of Contents ?? About ?? Getting Started Pre

Cybersecurity and Infrastructure Security Agency 1k Dec 9, 2022
NExfil is an OSINT tool written in python for finding profiles by username.

NExfil is an OSINT tool written in python for finding profiles by username. The provided usernames are checked on over 350 websites within few seconds.

thewhiteh4t 1.4k Jan 1, 2023
A simple multi-threaded distributed SSH brute-forcing tool written in Python.

OrbitalDump A simple multi-threaded distributed SSH brute-forcing tool written in Python. How it Works When the script is executed without the --proxi

K4YT3X 408 Jan 3, 2023
orfipy is a tool written in python/cython to extract ORFs in an extremely and fast and flexible manner

Introduction orfipy is a tool written in python/cython to extract ORFs in an extremely and fast and flexible manner. Other popular ORF searching tools

Urminder Singh 34 Nov 21, 2022
Evil-stalker - A simple tool written in python, it is so simple that it is based on google dorks

evil-stalker How to run First of all, you must install the necessary libraries.

rock3d 6 Nov 16, 2022
DependConfusion-X Tool is written in Python3 that scans and monitors list of hosts for Dependency Confusion

DependConfusion-X Tool is written in Python3 which allows security researcher/bug bounty hunter to scan and monitor list of hosts for Dependency Confusion.

Ali Fathi Ali Sawehli 4 Dec 21, 2021
SSL / TLS Checking Tool written in Python3

ssts-chk SSL / TLS Checking Tool written in Python3. This tool will perform the following functions: Connect the target given Analyze the secure conne

Douglas Berdeaux 2 Feb 12, 2022
labsecurity is a tool that brings together python scripts made for ethical hacking, in a single tool, through a console interface

labsecurity labsecurity is a tool that brings together python scripts made for ethical hacking, in a single tool, through a console interface. Warning

Dylan Meca 16 Dec 8, 2022
Osint-Tool - Information collection tool in python

Osint-Tool Herramienta para la recolección de información Pronto más opciones In

null 3 Apr 9, 2022