Code Monkey home page Code Monkey logo

spnavkbd's Introduction

spnavkbd - 0.1
--------------

1. About

The spnavkbd tool makes use of the open source spacenavd daemon to react to
movements of a 3d Connexion Space Navigator and emulate key presses to control
traditional keyboard oriented applications (in my case XBMC).

2. Build dependencies

libspnav (known to work with 0.2.2). In the spnavkbd directory run:

  $ wget http://downloads.sourceforge.net/spacenav/libspnav-0.2.2.tar.gz
  $ tar -xf libspnav-0.2.2.tar.gz

And using your distros package manager make sure you have either Lua or
LuaJIT2 installed. On some systems (Debian) make sure you have the "*-dev"
versions of these package installed.

3. Building

Run:

  $ make

To use a custom compiler or to link against LuaJIT2 do:

  $ CC=clang LUA_PKG_NAME=luajit make

4. Installing

You can run the spnavkbd binary from anywhere but ensure you have the
spnavkbd.lua config file in the current working directory.

5. Configuring

See the spnavkbd.lua file for the full list of configuration options at this
time.

The 3d-mouse-to-key mappings in the default config were chosen to best control
XBMC for my car computer.

From a birds-eye POV pushing the knob forward, backward, left and right
simulate the up, down, left and right arrow keys respectively.

Pushing down the knob simulates a Return press and pulling the knob up is a
BackSpace.

Twisting the knob in a clockwise and anti-clockwise directions simulate '-' &
'+' keys for volume control.

Button 0 (left button) is Escape to return to the top menu and button 1 is Tab
to switch between file view and the visualisation screen.

Tilting forward, backward, left and right doesn't do anything useful yet.

6. Caveats

At the moment you need to run spnavkbd as the same user of the applications
you which to control.

You can *probably* still launch spnavkbd from an rc or init script with:

  (*Note* this isn't working for me yet)
  # cd /path/to/spnavkbd/dir/
  # DISPLAY=:0.0 XAUTHORITY=$(ps -C X -f --no-header | sed -n 's/.*-auth //; s/ -[^ ].*//; p') su mason -c ./spnavkbd

Change 'X' to 'xinit' depending on how you launch X. And change 'mason' to the
user of the applications you wish to control.

Also make sure this is run after X has been started.

spnavkbd's People

Contributors

mason-larobina avatar

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.