Building and using the frontpanel
In June 2003 I wanted the possibility to control my VDR directly without using the infra-red remote control. So I thought about the game port. On my search for possibilities I found the webpage about compound joystick buttons. In the following section I will describe the circuit I've built, the buttons I've used and how the whole thing works in Linux and with VDR.
A Standard PC joystick port allows the usage of 4 joystick buttons through its 4 button lines. There are several ways to get around this. One of the simplest one is to use compound-button-presses. That means you press more than one button at a time, the 4 button bits are combined to a single 4 bit word giving 16 different button states. One is used as "no button pressed" so there are 15 combinations left, 14 of them are actually used.
This method just has one disadvantage: Only one button can be pressed at a time. But as in VDR exists no state where more than one button is pressed this is irrelevant.
The circuit consists of many diodes (25 of them). They are needed for preventing the cross-short of the button lines. I am using the common and cheap silicon switching diode 1N914. They are connected like on the following picture.
The rectangles with circles inside are plugs for cables. The 2, 7, 10, 14 and GND are pins of the joystick port. For GND I used pin 4. So that Linux detects this circuit as a real joystick 2 resistors (between 10K and 100K) must connect Axis 1 with +5V (pin 3 and 1) and Axis 2 with +5V (pin 6 and 8).
The buttons I obtained from reichelt.de, a german reseller for electronic equipment. The are about 10mm x 10mm in size. This are their order numbers:
- DT 6 SW (black)
- DT 6 RT (red)
- DT 6 GN (green)
- DT 6 GE (yellow)
- DT 6 BL (blue)
I mounted the button circuit board behind a 5 1/4 inch slot blind. It looks like on the following picture. At the moment I am using just 11 of the 14 possible buttons.
Get it working
To get the whole thing working in Linux, a kernel with joystick support is needed. The
following options have to be enabled (If modules are used they have to be loaded manually):
In Input core support enable:
- Input core support
- Joystick support
- Event interface support
- Game port support
- Classic ISA/PnP gameports (or another game port type that fits your hardware configuration)
- Classic PC analog joysticks and gamepads (as a module!)
insmod analog js=fullchfTo use the front panel as a remote in VDR, the joystick plugin is needed:
runvdr -PjoystickIf the plugin is loaded the first time it will start in "Learning Remote Control" mode.