root/NEWT0/trunk/sample/iPodKeyTest.sh

Revision 43, 1.6 kB (checked in by gnue, 3 years ago)

added 'sample/iPodKeyTest.sh' for iPod Linux

  • Property svn:executable set to *
Line 
1#!/usr/local/bin/newt
2
3constant IPOD_BUTTON_ACTION              := $\r;
4constant IPOD_BUTTON_MENU                := $m;
5constant IPOD_BUTTON_REWIND              := $w;
6constant IPOD_BUTTON_FORWARD             := $f;
7constant IPOD_BUTTON_PLAY                := $d;
8constant IPOD_SWITCH_HOLD                := $h;
9constant IPOD_WHEEL_CLOCKWISE            := $r;
10constant IPOD_WHEEL_ANTICLOCKWISE        := $l;
11constant IPOD_WHEEL_COUNTERCLOCKWISE     := $l;
12constant IPOD_REMOTE_PLAY                := $1;
13constant IPOD_REMOTE_VOL_UP              := $2;
14constant IPOD_REMOTE_VOL_DOWN            := $3;
15constant IPOD_REMOTE_FORWARD             := $4;
16constant IPOD_REMOTE_REWIND              := $5;
17
18local   c;
19
20while c := getch() do begin
21
22    if c = $\n or c = IPOD_BUTTON_ACTION then begin
23        print("Action\n");
24        break;
25    end;
26
27    if c = IPOD_BUTTON_MENU then
28        print("Menu\n")
29    else if c = IPOD_BUTTON_REWIND then
30        print("Rewind\n")
31    else if c = IPOD_BUTTON_FORWARD then
32        print("Forword\n")
33    else if c = IPOD_BUTTON_PLAY then
34        print("Play\n")
35    else if c = IPOD_SWITCH_HOLD then
36        print("Hold\n")
37    else if c = IPOD_WHEEL_CLOCKWISE then
38        print("Clock wise\n")
39    else if c = IPOD_WHEEL_ANTICLOCKWISE then
40        print("Anti clock wise\n")
41    else if c = IPOD_WHEEL_COUNTERCLOCKWISE then
42        print("Counter clock wise\n")
43    else if c = IPOD_REMOTE_PLAY then
44        print("Remote play\n")
45    else if c = IPOD_REMOTE_VOL_UP then
46        print("Remote vol up\n")
47    else if c = IPOD_REMOTE_VOL_DOWN then
48        print("Remote vol down\n")
49    else if c = IPOD_REMOTE_FORWARD then
50        print("Remote forward\n")
51    else if c = IPOD_REMOTE_REWIND then
52        print("Remote rewind\n")
53    else
54        print("### UNKNOWN ###\n");
55end;
Note: See TracBrowser for help on using the browser.