ref: 119574db78835ec73e048c78b57e04f3ded90ce2
parent: 1c30e3934527639deeb8444f52c5cd6791d3aa59
author: sl <sl@x1yg3>
date: Sun Jul 6 18:33:23 EDT 2025
add joy.gp100
--- a/INDEX
+++ b/INDEX
@@ -30,6 +30,7 @@
h - For reading text from bad websites on my phone.
hstats - Print simple stats sl want's to know about.
img - upload an image to http://img.stanleylieber.com
+joy.gp100 - Configure the Rii GP 100 USB game controller.
n700 - Set preferred X11 mouse acceleration for Lenovo N700 wireless mouse.
nauth - rcpu to or rimport from auth.inri.net
nn - run webcookies/webfs, populate factotum from secstore, perform some binds, run plumber.
--- /dev/null
+++ b/joy.gp100
@@ -1,0 +1,40 @@
+#!/bin/rc
+# Configure the Rii GP 100 USB game controller.
+# usage: nusb/joy epX.Y | joy.gp100 [N]
+~ $#* 0 && *=''
+awk -safe -v 'joy='$1 '
+ /^axis 0 0/ { k[0] = "left " }
+ /^axis 0 255/ { k[0] = "right " }
+ /^axis 0 127/ { k[0] = "" }
+
+ /^axis 1 0/ { k[1] = "up " }
+ /^axis 1 255/ { k[1] = "down " }
+ /^axis 1 127/ { k[1] = "" }
+
+ /^down 3$/ { k[3] = "b " }
+ /^down 2$/ { k[2] = "a " }
+ /^down 1$/ { k[8] = "x " }
+ /^down 4$/ { k[9] = "y " }
+ /^down 9$/ { k[4] = "control " }
+ /^down 10$/ { k[5] = "start " }
+ /^down 5$/ { k[6] = "l1 " }
+ /^down 6$/ { k[7] = "r1 " }
+
+ /^up 3$/ { k[3] = "" }
+ /^up 2$/ { k[2] = "" }
+ /^up 1$/ { k[8] = "" }
+ /^up 4$/ { k[9] = "" }
+ /^up 9$/ { k[4] = "" }
+ /^up 10$/ { k[5] = "" }
+ /^up 5$/ { k[6] = "" }
+ /^up 6$/ { k[7] = "" }
+
+ {
+ if(joy != "")
+ printf "joy%s ", joy
+ for(i in k)
+ printf k[i]
+ printf "\n"
+ fflush
+ }
+'
--
⑨