Skip to content

Commit

Permalink
Merge pull request #4 from DaElf/master
Browse files Browse the repository at this point in the history
Remove binaries -- Add Makefile

Remove hard coded paths.

Split duckpi.sh into 2 files
  • Loading branch information
ossiozac committed Sep 29, 2018
2 parents 7eb1710 + 1dcf9f3 commit 672cd72
Show file tree
Hide file tree
Showing 8 changed files with 173 additions and 167 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hid-gadget-test
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

all: hid-gadget-test

hid-gadget-test: hid-gadget-test.c
$(CC) -g -O -o $@ $<
120 changes: 120 additions & 0 deletions convert.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
#!/bin/bash

function convert()
{
local kbcode=""

if [ "$1" == " " ]
then
kbcode='space'
elif [ "$1" == "!" ]
then
kbcode='left-shift 1'
elif [ "$1" == "." ]
then
kbcode='period'
elif [ "$1" == "\`" ]
then
kbcode='backquote'
elif [ "$1" == "~" ]
then
kbcode='left-shift tilde'
elif [ "$1" == "+" ]
then
kbcode='kp-plus'
elif [ "$1" == "=" ]
then
kbcode='equal'
elif [ "$1" == "_" ]
then
kbcode='left-shift minus'
elif [ "$1" == "-" ]
then
kbcode='minus'
elif [ "$1" == "\"" ]
then
kbcode='left-shift quote'
elif [ "$1" == "'" ]
then
kbcode='quote'
elif [ "$1" == ":" ]
then
kbcode='left-shift semicolon'
elif [ "$1" == ";" ]
then
kbcode='semicolon'
elif [ "$1" == "<" ]
then
kbcode='left-shift comma'
elif [ "$1" == "," ]
then
kbcode='comma'
elif [ "$1" == ">" ]
then
kbcode='left-shift period'
elif [ "$1" == "?" ]
then
kbcode='left-shift slash'
elif [ "$1" == "\\" ]
then
kbcode='backslash'
elif [ "$1" == "|" ]
then
kbcode='left-shift backslash'
elif [ "$1" == "/" ]
then
kbcode='slash'
elif [ "$1" == "{" ]
then
kbcode='left-shift lbracket'
elif [ "$1" == "}" ]
then
kbcode='left-shift rbracket'
elif [ "$1" == "(" ]
then
kbcode='left-shift 9'
elif [ "$1" == ")" ]
then
kbcode='left-shift 0'
elif [ "$1" == "[" ]
then
kbcode='lbracket'
elif [ "$1" == "]" ]
then
kbcode='rbracket'
elif [ "$1" == "#" ]
then
kbcode='left-shift 3'
elif [ "$1" == "@" ]
then
kbcode='left-shift 2'
elif [ "$1" == "$" ]
then
kbcode='left-shift 4'
elif [ "$1" == "%" ]
then
kbcode='left-shift 5'
elif [ "$1" == "^" ]
then
kbcode='left-shift 6'
elif [ "$1" == "&" ]
then
kbcode='left-shift 7'
elif [ "$1" == "*" ]
then
kbcode='kp-multiply'

else
case $1 in
[[:upper:]])
tmp=$1
kbcode="left-shift ${tmp,,}"
;;
*)
kbcode="$1"
;;
esac
fi

echo "$kbcode"
}
Loading

0 comments on commit 672cd72

Please sign in to comment.