Coder Social home page Coder Social logo

clutch's Introduction

clutch

I wrote clutch to let me use this $9 foot pedal to control vim without hardware modification.

http://www.amazon.com/gp/product/B0098PLPOI/ref=oh_details_o00_s00_i00?ie=UTF8&psc=1

By default the pedal just sends a "b key pressed" event when you push it down and a "b key released" when you lift your foot.

This very small utility lets you define what keys you actually want to happen when the pedal sends these events.

By default, it will emulate tapping the i key when you put your foot down and will emulate tapping the ESCAPE key when you lift your foot up.

Please read the very short one-file source to see what other keys are available.

Use:

clutch MUST be run as root. OSX only allows root programs to hijack USB keyboards ( the os thinks the foot pedal is a one-key keyboard... )

default: i on down, ESCAPE on up:

sudo ./clutch 

Example: a on down, ESCAPE on up:

sudo ./clutch a

Example: a on down, ESCAPE on up, but ensure that SHIFT is held down while a is being pressed (has the effect of A in your editor)

sudo ./clutch a ESCAPE SHIFT

Similar work:

https://github.com/alevchuk/vim-clutch is the first implementation that I was aware of. Unfortunately, it requires hardware hacking. I just use the operating system's accessibility API to fake the key sends, so no hardware hacking needed for "organ playing".

TODO:

I would really like to be able to program a series of keyboard events for each foot pedal event.

I am currently thinking of a mini dsl like this:

./clutch 'ESCAPE,+SHIFT,a,-SHIFT' 'ESCAPE'

This would let you specify arbitrary key events (using + for pressing and - for releasing, with neither for a simulated 'tap')

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.