Added lcd brightness up/down to evmapperd
authorskeezix <skeezix@flotsam-vm.(none)>
Thu, 18 Mar 2010 02:09:54 +0000 (22:09 -0400)
committerskeezix <skeezix@flotsam-vm.(none)>
Thu, 18 Mar 2010 02:09:54 +0000 (22:09 -0400)
Also added del, comma, and number keys as keys that can be mapped, in case we need to
do testing or for me with a broken power button to map comma -> power :P
added crappy op_bright_up/down scripts, vimacs can fix them up :)

apps/pndevmapperd.c
deployment/etc/pandora/conf/eventmap
testdata/scripts/op_bright_down.sh [new file with mode: 0755]
testdata/scripts/op_bright_up.sh [new file with mode: 0755]

index 292b27e..57a2f11 100644 (file)
@@ -61,6 +61,20 @@ keycode_t keycodes[] = {
   { KEY_A, "a" },
   { KEY_MENU, "pandora" },
   { KEY_POWER, "power" },
+  { KEY_DELETE, "del" },
+  { KEY_COMMA, "comma" },
+  { KEY_1, "1" },
+  { KEY_2, "2" },
+  { KEY_3, "3" },
+  { KEY_4, "4" },
+  { KEY_5, "5" },
+  { KEY_6, "6" },
+  { KEY_7, "7" },
+  { KEY_8, "8" },
+  { KEY_9, "9" },
+  { KEY_0, "0" },
+  { KEY_BRIGHTNESSDOWN, "lcdbrightdown" },
+  { KEY_BRIGHTNESSUP, "lcdbrightup" },
   { -1, NULL }
 };
 
index bcae576..988e380 100644 (file)
@@ -6,6 +6,8 @@
 # pass 'hold duration' to the script
 pandora /usr/pandora/scripts/op_menu.sh
 power  /usr/pandora/scripts/op_power.sh
+lcdbrightdown  /usr/pandora/scripts/op_bright_down.sh
+lcdbrightup    /usr/pandora/scripts/op_bright_up.sh
 
 [events]
 # pass 'action code' to the script
diff --git a/testdata/scripts/op_bright_down.sh b/testdata/scripts/op_bright_down.sh
new file mode 100755 (executable)
index 0000000..5030b0b
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/bash
+cur=$(cat /sys/devices/platform/twl4030-pwm0-bl/backlight/twl4030-pwm0-bl/brightness);
+echo $(($cur-10)) > /sys/devices/platform/twl4030-pwm0-bl/backlight/twl4030-pwm0-bl/brightness
diff --git a/testdata/scripts/op_bright_up.sh b/testdata/scripts/op_bright_up.sh
new file mode 100755 (executable)
index 0000000..b3f45d6
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/bash
+cur=$(cat /sys/devices/platform/twl4030-pwm0-bl/backlight/twl4030-pwm0-bl/brightness);
+echo $(($cur+10)) > /sys/devices/platform/twl4030-pwm0-bl/backlight/twl4030-pwm0-bl/brightness