Skip to content

Latest commit

 

History

History
70 lines (64 loc) · 3.17 KB

README.org

File metadata and controls

70 lines (64 loc) · 3.17 KB

Introduction

Define your keyboard layout as C++ class. Primarily focused on implementing my keyboard layout.

Why use it instead of xmodmap/xcape

Installation

Install bazel

apt-get install -y software-properties-common python-software-properties

# C++
apt-get install -y g++

# Java 8
echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections
add-apt-repository -y ppa:webupd8team/java
sudo apt-get update
apt-get install -y oracle-java8-installer

# Bazel dependencies
apt-get install -y pkg-config zip zlib1g-dev unzip git

# Build bazel
git clone https://github.com/google/bazel.git ~/bazel && cd ~/bazel
~/bazel/compile.sh
sudo cp ~/bazel/bazel-bin/src/bazel /usr/local/bin

Build from source on Arch Linux

pacman -S jdk8-openjdk zip unzip zlib pkg-config

mkdir -p ~/git_repos/github/google
cd ~/git_repos/github/google
git clone https://github.com/google/bazel.git  
cd bazel
./compile.sh
sudo cp /home/kozikow/git_repos/github/google/bazel/output/bazel /usr/local/bin/

Build keyremaplinux

git clone https://github.com/kozikow/keyremaplinux ~/keyremaplinux
cd ~/keyremaplinux
bazel build //keyremaplinux:keyremaplinux

Running on Linux

Run one-of:

sudo nice -n -20 ./bazel-bin/keyremaplinux/keyremaplinux kozikow_standard

Enable automatic restarts

sudo cp keyremaplinux.service /etc/systemd/system/multi-user.target.wants/keyremaplinux.service
sudo systemctl enable keyremaplinux.service
sudo systemctl restart keyremaplinux.service

Implementing the new layout

  1. Extend Remapper and implement function Remap.
  2. For example KozikowLayoutRemapper.
  3. In function Remap, consume and produce Linux input event from input.h. What you consume is what user have typed. What you produce is what OS will see.
  4. Event codes are defined in input-event-codes.h

Run tests

bazel test //keyremaplinux:all --test_output=errors