| 1 | #!/usr/local/bin/newt |
|---|
| 2 | |
|---|
| 3 | constant IPOD_BUTTON_ACTION := $\r; |
|---|
| 4 | constant IPOD_BUTTON_MENU := $m; |
|---|
| 5 | constant IPOD_BUTTON_REWIND := $w; |
|---|
| 6 | constant IPOD_BUTTON_FORWARD := $f; |
|---|
| 7 | constant IPOD_BUTTON_PLAY := $d; |
|---|
| 8 | constant IPOD_SWITCH_HOLD := $h; |
|---|
| 9 | constant IPOD_WHEEL_CLOCKWISE := $r; |
|---|
| 10 | constant IPOD_WHEEL_ANTICLOCKWISE := $l; |
|---|
| 11 | constant IPOD_WHEEL_COUNTERCLOCKWISE := $l; |
|---|
| 12 | constant IPOD_REMOTE_PLAY := $1; |
|---|
| 13 | constant IPOD_REMOTE_VOL_UP := $2; |
|---|
| 14 | constant IPOD_REMOTE_VOL_DOWN := $3; |
|---|
| 15 | constant IPOD_REMOTE_FORWARD := $4; |
|---|
| 16 | constant IPOD_REMOTE_REWIND := $5; |
|---|
| 17 | |
|---|
| 18 | local c; |
|---|
| 19 | |
|---|
| 20 | while 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"); |
|---|
| 55 | end; |
|---|