# Fix Eclipse keyboard shortcuts with non-Latin layouts on GNU/Linux

*2015-05-19*

> Restore keyboard shortcuts with non-Latin layouts in older Eclipse versions on GNU/Linux by building and using eclipse-hotkeys-fix.

I ran into an annoying [bug in Eclipse on GNU/Linux](https://bugs.eclipse.org/bugs/show_bug.cgi?id=61190) when switching between keyboard layouts. Shortcuts such as **Ctrl+C** and **Ctrl+V** worked with the English layout but stopped working when I switched to Bulgarian.

After some searching, I found [eclipse-hotkeys-fix](https://github.com/amozzhuhin/eclipse-hotkeys-fix), a workaround by [amozzhuhin](https://github.com/amozzhuhin). It provides a shared library and a launcher script for Eclipse.

**Update:** This bug was later [fixed for Eclipse 4.7.2](https://bugs.eclipse.org/bugs/show_bug.cgi?id=61190#c123). The workaround below is for older affected installations.

## Building the workaround

Build the library against the same GTK version used by your Eclipse installation. These steps follow the [project's build instructions](https://github.com/amozzhuhin/eclipse-hotkeys-fix#build) and use GTK 3.

On Debian or Ubuntu, install the build tools and GTK development package:

```sh
sudo apt-get install git cmake build-essential libgtk-3-dev
```

Download and build the library:

```sh
git clone https://github.com/amozzhuhin/eclipse-hotkeys-fix.git
mkdir eclipse-hotkeys-fix-build
cd eclipse-hotkeys-fix-build
cmake -DGTK3=1 ../eclipse-hotkeys-fix
make
```

For GTK 2, install `libgtk2.0-dev` instead of `libgtk-3-dev` and omit `-DGTK3=1` from the CMake command.

## Starting Eclipse with the workaround

Close Eclipse. Copy `lib/libeclipse-hotkeys-fix.so` and `eclipse.sh` from the build directory into the directory containing the Eclipse executable.

From that directory, make the launcher executable and run it:

```sh
chmod +x eclipse.sh
./eclipse.sh
```

Use this launcher whenever you need the workaround, then switch keyboard layouts and check that the shortcuts work.

