From fbc76260dd8c7cf8f9e67dd92b816a6669aa46b3 Mon Sep 17 00:00:00 2001 From: girst Date: Mon, 15 Feb 2016 21:41:39 +0100 Subject: [PATCH] am bored, added nice error screen on parameter count mismatch --- main.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 8a83a76..071c837 100644 --- a/main.c +++ b/main.c @@ -1,10 +1,11 @@ /* -description: sends a sequence of keystrokes to the hid device. +description: sends a sequence of keystrokes provided from stdin to the hid +device. +stops typing at: control characters (including newline), chars not in table, EOF parameters: device file (e.g. /dev/hidg0) keyboard layout (1=en_us, 2=de_at, 3=de_at-nodeadkeys) unicode method: 1=gtk_holddown, 2=gtk_spaceend, 3=windows - the string to send (as whitespace is important, the `echo` way of concatenating all parameters is not supported. if your string has white space in it and you are in an interactive session, quote your string.) */ #include #include @@ -40,6 +41,16 @@ int main (int argc, char** argv) { if (argc != NUM_P) { fprintf (stderr, "Usage: %s \n", argv[P_EXE]); fprintf (stderr, "Takes string to type from stdin\n"); + fprintf (stderr, ":\ton the Raspberry Pi usually /dev/hidg0\n"); + fprintf (stderr, ":\n\t%d\t%s\n\t%d\t%s\n\t%d\t%s\n", + en_US, "en_US", + de_AT, "de_AT (w/ dead keys)", + de_ND, "de_AT-nodeadkeys"); + fprintf (stderr, ":\n\t%d\t%s\n\t%d\t%s\n\t%d\t%s\n\t%d\t%s\n", + SKIP, "skip over unicode characters", + GTK_HOLD, "X11 Holddown: CTRL+SHIFT+[u, hex]", + GTK_SPACE, "X11 Space: CTRL+SHIFT+u, hex, SPACE", + WINDOWS, "Windows: Alt+[Numpad]"); return ERR_ARGCOUNT; } FILE* hid_dev = fopen ("/dev/hidg0", "w"); -- 2.39.3