GithubHelp home page GithubHelp logo

smerrony / keypadder Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 1.0 594 KB

Keypadder is a programmable virtual keypad you can access via a mobile phone or tablet

License: GNU General Public License v3.0

Ada 100.00%
ada keyboard keypad linux mobile programmable tablet macro macropad

keypadder's Introduction

Keypadder

Keypadder is a programmable virtual keypad for your Linux desktop that you can access via a mobile phone or tablet.

Screenshot1 Screenshot2 Screenshot3

Keypadder runs on your desktop machine and provides a mobile/tablet-friendly web page that you use from a tablet or phone to send frequently-used, awkward, or difficult-to-remember key combinations to the currently-focused desktop application.

Amongst other things, the author uses it with Thunderbird and LibreOffice Writer for typing accented characters, with MuseScore to provide a keypad similar to a certain commercial score writing application, and with Firefox for accented characters and Emojis in social media.

It's a great use for one of those old smartphones or tablets you have lying in that drawer!

Key Features

  • Simple TOML definition for pads - examples provided
  • Flexible layout possibilities to suit portrait or landscape modes
  • Runs enitrely locally, no internet required, no JavaScript libraries
  • Keytops can be strings &/or HTML entities eg. à
  • No app required on phone/tablet - it uses the browser
  • Keys can send multiple keystrokes, can use for macros

(Keypadder currently runs only on 64-bit Linux systems)

Build and Install

A binary (.deb) version for modern 64-bit Debian-based systems may be available as part of a release.

The Keypadder source is hosted on GitHub.

It is written entirely in GNU Ada (GNAT). You may build it using either the Alire build system or plain old gprbuild.
Building via Alire is preferred where it is possible as all necessary dependencies will be obtained for you automatically.

Alire Build

Until the Alire crate is available, you should download (or clone) the source from Github and run alr build in the top-level directory.

TODO - Add more detail here once Alire crate is available

Gprbuild Build

Prerequisites

You should the development version of libaws via your package manager. You will also need ada-toml from https://github.com/pmderodat/ada-toml - follow the instructions there to install it.

Then...

mkdir obj
gprbuild -Pnon_alire

Running Keypadder

You need to start Keypadder on your desktop machine, then browse to the web page it provides on your mobile device.

Once it is running you use the desktop as normal and can use a keypad to insert keystrokes into the currently-focused window.

On the Desktop

keypadder -h will give a list of all options.

$ ./bin/keypadder -h
Usage of keypadder:
  <config-file>       Configuration file for keypadder (required to run)
  --dumpkeys          List all defined key mnemonics
  -h | --help         This help
  -V | --version      Show the version of keypadder and exit
  -v | --verbose      Show lots of detail when running

N.B. Keypadder must be run with root privileges in order to inject keystrokes into your system.

Eg: sudo ./bin/keypadder examples/keypad.toml

On the Phone/Tablet

With a browser, navigate to http://<ip addr of desktop>:<port configured>/

Eg: http://192.168.1.200:8082/

If your desktop has a name on your LAN, you can use it in place of the IP address.

Eg: http//stevedesktop.lan:8082/

Creating Your Own Keypads

See our Configuration Guide.

keypadder's People

Contributors

mgrojo avatar smerrony avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

mgrojo

keypadder's Issues

Suggestion: dump printable character with `--dumpkeys`

Describe the bug
The # virtual key produced ç instead of #.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Hex'
  2. Click on '#'

Expected behavior
I expected # to be input, but it produced ç.

Desktop (please complete the following information):

  • OS: Ubuntu 22.04.1 LTS
  • Browser Firefox
  • Keyboard distribution: Spain

Additional context

Congratulations on this useful and simple tool.

I suppose this depends on keyboard distribution.

Edit: Before submitting this issue I read the documentation, and understand this is expected behaviour, so you can directly close it, but I've thought that a possible improvement is to dump the actual printable character (when applicable) when the --dumpkeys option is used. In that way, you could predict which character will be printed while configuring your pads.

Storage_Error when the file has more than 8 tabs

Describe the bug
There's a Storage_Error when the file has more than 8 tabs or more than some other unknown limit.

To Reproduce
Steps to reproduce the behavior:

  1. Unzip math_conf.zip in keypadder root
  2. Run sudo bin/keypadder --verbose examples/math_no_ok.toml
  3. A Storage_Error is raised for an Unbounded_String object:
[...]
Key No.  9 is: &#x2119;
Key No.  10 is: &#x211A;
Key No.  11 is: &#x2124;
Error loading configuration file: examples/math.toml
raised PROGRAM_ERROR : adjust/finalize raised STORAGE_ERROR: s-intman.adb:136 explicit raise
[/home/mgr/src/github/SMerrony/keypadder/bin/../../../../..//.config/alire/cache/dependencies/gnat_native_12.2.1_11f3b811/lib/gcc/x86_64-pc-linux-gnu/12.2.0/adalib/libgnat-12.so]
0x7f4bec5b70b8 ada__strings__unbound
ed___assign__2.cold at ???
[bin/keypadder]
0x4394b2 Config.Load_Config_File at config.adb:121
0x421438 Keypadder at keypadder.adb:68
0x422edc Main at b__keypadder.adb:1331
[/lib/x86_64-linux-gnu/libc.so.6]
0x7f4bec14bd8e
0x7f4bec14be3e
[bin/keypadder]
0x420883 _start at ???
0xfffffffffffffffe

Expected behavior
Although the configuration file is big, I suppose it should be loaded, or at least, a message explaining that some limit has been surpassed.

I truncated the file (examples/math.toml) to have 8 tabs and it works.

Desktop (please complete the following information):

  • OS: Ubuntu 22.04.1 LTS
  • GNAT version: gnat_native_12.2.1_11f3b811

Additional context
It might be a problem in GNAT or in ada-toml?

Add option for dropdown tab selector

Is your feature request related to a problem? Please describe.
Too many tabs cause the tab labels to disappear (and are hard to use/find).

Describe the solution you'd like
Add an optional configuration item to the [keypadder] sectiion.
If no such item is supplied default to tabs if there are seven or fewer tabs, dropdown if there are more.

Program raises CONSTRAINT_ERROR on invalid configuration (no port)

Describe the bug
I made a new configuration file, but I forgot about the keypadder section.

To Reproduce
Steps to reproduce the behavior:

  1. Remove keypadder section in examples/keypadder.xml
  2. Run normally
  3. Program fails with CONSTRAINT_ERROR due to invalid data reading the port number

Expected behavior
Either a default value is used or the program aborts when reading the configuration file, stating that the section is mandatory.

Additional context
I fixed it using a default initialization, but you might prefer the other way.

diff --git a/src/config.ads b/src/config.ads
index 2c68b63..9d3212e 100644
--- a/src/config.ads
+++ b/src/config.ads
@@ -11,7 +11,7 @@ package Config is
 
    type Port_T is range 1 .. 65535;
    type Keypadder_Conf_T is record
-      Port : Port_T;
+      Port : Port_T := 8082;
    end record;
 
    type Up_Down_T is (Up, Down);

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.