History

Added buttonserver support for Nook Color Specify the configuration file for buttonserver with -c.

Joel Armstrong committed 15 years ago

Commit 571aa1c1 parent 9447faa3 files · +29 −6Browse files

Unified · Split

3 files
  1. appl/buttonserver.b +13 −4
  2. emu/port/main.c +5 −2
  3. etc/buttonserver-nook-color.cfg +11 −0
appl/buttonserver.b+13−4
@@ -1,10 +1,8 @@
1# TODO: handle clients closing file
2implement ButtonServer;1implement ButtonServer;
3 2
4include "sys.m";3include "sys.m";
5sys : Sys;4sys : Sys;
6include "draw.m";5include "draw.m";
7include "arg.m";
8include "styx.m";6include "styx.m";
9styx: Styx;7styx: Styx;
10Rmsg, Tmsg: import styx;8Rmsg, Tmsg: import styx;
@@ -15,7 +13,10 @@ nametree: Nametree; · 4 unmodified lines
15Tree: import nametree;13Tree: import nametree;
16include "cfg.m";14include "cfg.m";
17cfg: Cfg;15cfg: Cfg;
16include "arg.m";
17arg : Arg;
18 18
19cfgfile := "/etc/buttonserver.cfg";
19mntflg := Sys->MBEFORE;20mntflg := Sys->MBEFORE;
20mntpt := "/dev";21mntpt := "/dev";
21Qroot, Qbuttons : con big iota;22Qroot, Qbuttons : con big iota;
@@ -43,9 +44,17 @@ init(nil: ref Draw->Context, args: list of string) · 21 unmodified lines
43 styxservers->init(styx);44 styxservers->init(styx);
44 nametree = load Nametree Nametree->PATH;45 nametree = load Nametree Nametree->PATH;
45 nametree->init();46 nametree->init();
47 arg = load Arg Arg->PATH;
48 arg->init(args);
49 while((c := arg->opt()) != 0) {
50 case c {
51 'c' => cfgfile = arg->arg();
52 * => sys->print("unrecognized option %c\n", c);
53 }
54 }
46 cfg = load Cfg Cfg->PATH;55 cfg = load Cfg Cfg->PATH;
47 if(cfg->init("/etc/buttonserver.cfg") != "") {56 if(cfg->init(cfgfile) != "") {
48 raise "could not access configuration file";57 raise sys->sprint("could not access configuration file %s", cfgfile);
49 }58 }
50 59
51 for(i := 0; i < MAX_READERS; i++) {60 for(i := 0; i < MAX_READERS; i++) {
emu/port/main.c+5−2
@@ -147,9 +147,12 @@ option(int argc, char *argv[], void (*badusage)(void)) · 146 unmodified lines
147 system("echo 255 > /sys/class/backlight/s5p_bl/brightness");147 system("echo 255 > /sys/class/backlight/s5p_bl/brightness");
148 }148 }
149 else if (type == 'c') {149 else if (type == 'c') {
150 eventfiles = malloc(2*sizeof(char *));150 eventfiles = malloc(5*sizeof(char *));
151 eventfiles[0] = "/dev/input/event0";151 eventfiles[0] = "/dev/input/event0";
152 eventfiles[1] = NULL;152 eventfiles[1] = "/dev/input/event1";
153 eventfiles[2] = "/dev/input/event2";
154 eventfiles[3] = "/dev/input/event3";
155 eventfiles[4] = NULL;
153 displaydepth = 32;156 displaydepth = 32;
154 geom("600x1024");157 geom("600x1024");
155 rotation_opt = 1;158 rotation_opt = 1;
etc/buttonserver-nook-color.cfg+11−0
@@ -0,0 +1,11 @@
1# Nook Color
2"0 1 102 1"="home press"
3"0 1 102 0"="home release"
4"0 1 116 1"="power press"
5"0 1 116 0"="power release"
6"1 1 114 1"="volume down press"
7"1 1 114 2"="volume down hold"
8"1 1 114 0"="volume down release"
9"1 1 115 1"="volume up press"
10"1 1 115 2"="volume up hold"
11"1 1 115 0"="volume up release"

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t