• Stars
    star
    390
  • Rank 106,588 (Top 3 %)
  • Language
    C
  • License
    MIT License
  • Created over 11 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Command-line utility for PCsensor and Scythe foot switches

Build Status

Footswitch

Command line utlities for programming PCsensor and Scythe foot switches.

The following list of devices are supported:

vendorId productId Program
0c45 7403 footswitch
0c45 7404 footswitch
413d 2107 footswitch
1a86 e026 footswitch
0426 3011 scythe
055a 0998 scythe2

You can find the vendorId and productId of your device using the lsusb command on Linux.

The same kind of foot switches are used for building the popular VIM Clutch.

Building

The programs are using the hidapi library and should work on Linux and OSX. To build on Linux:

sudo apt-get install libhidapi-dev
git clone https://github.com/rgerganov/footswitch.git
cd footswitch
make
sudo make install

The install target installs udev rules on Linux which allow running the programs without root. You may need to use sudo otherwise.

To build on OSX:

brew tap rgerganov/footswitch https://github.com/rgerganov/footswitch.git
brew install --HEAD footswitch

Usage

footswitch [-123] [-r] [-s <string>] [-S <raw_string>] [-ak <key>] [-m <modifier>] [-b <button>] [-xyw <XYW>]
   -r          - read all pedals
   -1          - program the first pedal
   -2          - program the second pedal (default)
   -3          - program the third pedal
   -s string   - append the specified string
   -S rstring  - append the specified raw string (hex numbers delimited with spaces)
   -a key      - append the specified key
   -k key      - write the specified key
   -m modifier - ctrl|shift|alt|win
   -b button   - mouse_left|mouse_middle|mouse_right
   -x X        - move the mouse cursor horizontally by X pixels
   -y Y        - move the mouse cursor vertically by Y pixels
   -w W        - move the mouse wheel by W

You cannot mix -sSa options with -kmbxyw options for one and the same pedal

_

scythe [-123] [-r] [-a <key>] [-m <modifier>] [-b <button>]
   -r          - read all pedals
   -1          - program the first pedal
   -2          - program the second pedal (default)
   -3          - program the third pedal
   -a key      - append the specified key
   -m modifier - ctrl|shift|alt|win
   -b button   - mouse_left|mouse_double|mouse_right

You cannot mix -a and -m options with -b option for one and the same pedal

Examples for PCsensor

footswitch -r
    read the persisted function in each pedal and print it on the console
footswitch -k a
    program the second pedal to print the letter 'a' (also work for single pedal devices);
    as a general rule you don't need to specify -1, -2 or -3 if you have only one pedal
footswitch -1 -k a -2 -k b -3 -k c
    program the first pedal to print 'a', second pedal to print 'b' and third pedal to print 'c'
footswitch -1 -k esc -2 -k enter
    program the first pedal as Escape key and the second pedal as Enter key
footswitch -1 -m ctrl -k a -3 -m alt -k f4
    program the first pedal as Ctrl+a and the third pedal as Alt+F4
footswitch -m ctrl -b mouse_middle
    program the second pedal as Ctrl+<middle_mouse_click>
footswitch -s 'hello world'
    program the second pedal to print 'hello world'
footswitch -s 'hello' -s ' ' -s 'world'
    this will also program the second pedal to print 'hello world';
    you can specify multiple -s options and each option will append to the resulting string
footswitch -a esc -a i
    program the second pedal to produce Escape and then the letter 'i'
footswitch -s ls -a enter
    program the second pedal to print 'ls' and then hit Enter
footswitch -S '29 C'
    program the second pedal with the specified 'raw' string (hex numbers delimited with spaces);
    you can find the hex code for each key at http://www.freebsddiary.org/APC/usb_hid_usages.php
footswitch -1 -x 10 -2 -w 15 -3 -y -10
    program first pedal to move the mouse cursor 10 pixels left;
    second pedal to move mouse wheel 15 units up;
    third pedal to move the mouse cursor 10 pixels right

Examples for Scythe

scythe -r
    read the persisted function in each pedal and print it on the console
scythe -1 -a a -2 -a b -3 -a c
    program the first pedal to print 'a', second pedal to print 'b' and third pedal to print 'c'
scythe -1 -m ctrl -a h -a o -2 -m alt -a f4 -3 -b mouse_double
    program the first pedal as Ctrl+h+o, the second pedal as Alt+F4 and the third pedal as double click

Hardware issues

Several people have reported misbehaviors with the PCsensor footswitch due to hardware issues. If the pedal is continuously sending a keypress without being pressed, then most probably some of the elements do not make good contact with the PCB. Follow the instructions contributed by @krasiyan on how to verify and fix this.

Author

Radoslav Gerganov

Contributors

More Repositories

1

ggtag

programmable e-paper tag with RFID
C
262
star
2

py-air-control

Command line app for controlling Philips air purifiers
Python
245
star
3

rf-car

Controlling RC cars with HackRF
C++
130
star
4

nfqsed

Modify network traffic with netfilter_queue
C
86
star
5

gen5fw

Firmware tools for Mobis Gen5 navigation
Python
84
star
6

tesla-opener

Open Tesla charging port with HackRF
C++
70
star
7

shanocast

Google Chromecast Reciever
Nix
62
star
8

spoof_temp

Spoof temperature sensor with HackRF/FlipperZero
C++
38
star
9

aprs-sdr

APRS tracker with an SDR
C++
30
star
10

mks

Client for VMware consoles
Python
25
star
11

xxe-example

XXE vulnerability demo
Java
22
star
12

mario

Inject keystrokes with LEGO Mario
Python
19
star
13

ggwave-fm

Transmit ggwave encoded messages with an SDR
C++
16
star
14

dlp

Discrete logarithm problem
Java
12
star
15

vmdecrypt

Decrypt multicast Verimatrix streams
Go
9
star
16

pyvmdk

Python scripts for VMDK manipulations
Python
7
star
17

solo-pgp

PGP with Solo key
Python
5
star
18

rfbot

Slack bot for doing RF stuff
C++
4
star
19

vmware-vspc

Virtual Serial Port Concentrator
Python
4
star
20

sms

Send SMS messages from command line
C++
4
star
21

usdr

C++
3
star
22

osmo-sdr

Mirror of osmocom/osmo-sdr
C
3
star
23

stereovision

Capture video from two cameras
C
3
star
24

rabbit-comet

Comet application delivering messages from RabbitMQ broker
Java
3
star
25

remote-kbd

C
2
star
26

qsl

QSL cards gallery
Java
2
star
27

ctkip

Java
2
star
28

cec-watch

Emit a keypress when the display is powered off
C
1
star
29

stm32f3

Applications using the STM32F3 Discovery board
C
1
star
30

p4actions

Eclipse plug-in that adds custom actions to pending Perforce changelists
Java
1
star
31

nova-mksproxy

Nova console proxy for VMware instances
Python
1
star
32

openenclave-openssl

For using the OpenSSL libraries with the Open Enclave SDK
CMake
1
star