Giter Site home page Giter Site logo

shahriar-0 / capslock-keybindings Goto Github PK

View Code? Open in Web Editor NEW

This project forked from misaghm/capslock-keybindings

2.0 0.0 0.0 22 KB

Custom keybindings remapping the arrow keys to Caps+HJKL and more.

License: MIT License

Python 48.02% AutoHotkey 51.98%

capslock-keybindings's Introduction

Capslock Keybindings

About

This is my preferred custom set of keybindings to make use of the capslock and remap the arrow keys to JKLI and more.

Keybindings

Method 1:

Caps + Result
J K L I ← ↓ → ↑
U O Home / End
H ; Backspace / Delete
D F PageUp / PageDown
M Escape

Method 2:

Caps + Result
H J K L ← ↑ ↓ →
Y O Home / End
U I Backspace / Delete
D F PageUp / PageDown
; Escape

As well as all the combinations with ctrl/shift/alt.

Windows

The Method 1 Script and Method 2 Script is in the Autohotkey folder and requires Autohotkey (v1) to run. Also their respective Autohotkey v2 can be found in the same folder.
You can also get a compiled exe in the releases section.

Additional Hotkeys

  • Caps + T: open/focus cmd.
  • Win + ': suspend/unsuspend the hotkeys.

Automatic Startup

To automatically start the script at login, open Run (win + r) and write shell:startup, then copy a shortcut of the file there.

For the hotkeys to work in an elevated environment, the script has to be ran as administrator.

To do this automatically at startup, either:
Right-click the exe, go to Properties > Compatibility > Run this program as admin and prompt UAC every time, or use taskschd.msc instead of shell:startup like so:

  • Open Run and write taskschd.msc.
  • Create task.
  • Check "Run with highest privilges".
  • In the Triggers tab, add a new "At log on" trigger.
  • In the Actions tab, add a new "Start a program" action and select the script's exe.

Linux

The scripts are in the Autokey folder and require Autokey to be installed.
Place the CapsKeybinds folder in ~/.config/autokey/data/ and run Autokey.

Notes

The scripts use the hyper key for the hotkeys. So you have to remap capslock to be used as a hyper key.
You should be able to find a way by searching this for your distro.

Here is a way to do it in Ubuntu:

Ubuntu

  • Install the GNOME Tweak Tool (GNOME Tweaks)
  • "Keyboard & Mouse"
  • "Additional Layout Options"
  • "Caps Lock behavior"
  • "Make Caps Lock an additional Hyper"

A problem that may occur is that Super + L is the Lockscreen shortcut, So if Hyper and Super are the same, Caps + L will trigger the lockscreen.
If such is the case, you can either disable the lockscreen shortcut in settings, or try to fix the hyper/super problem.

You can see the keyboard modifier maps by typing xmodmap in the terminal.
The problem is there if hyper and super are both mod4.
To move hyper to mod3:

  • Make this file ~/.xmodmap with the following content:
remove mod4 = Hyper_L
add mod3 = Hyper_L
  • Now we have to type xmodmap ~/.xmodmap in the terminal to run these commands. To do this automatically at login:

    • Open Startup Applications
    • Add a new item with the following as the command:
/bin/bash -c "sleep 10 && xmodmap ~/.xmodmap"

For more info, this will add a .desktop file in ~/.config/autostart

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.