diff options
Diffstat (limited to 'utils/nwztools/plattools/test_display.c')
-rw-r--r-- | utils/nwztools/plattools/test_display.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/utils/nwztools/plattools/test_display.c b/utils/nwztools/plattools/test_display.c index 1ebf40e813..0a8089eca9 100644 --- a/utils/nwztools/plattools/test_display.c +++ b/utils/nwztools/plattools/test_display.c | |||
@@ -25,7 +25,27 @@ int NWZ_TOOL_MAIN(test_display)(int argc, char **argv) | |||
25 | { | 25 | { |
26 | /* clear screen and display welcome message */ | 26 | /* clear screen and display welcome message */ |
27 | nwz_lcdmsg(true, 0, 0, "test_display"); | 27 | nwz_lcdmsg(true, 0, 0, "test_display"); |
28 | nwz_lcdmsg(false, 3, 10, "This program will stop in 5 seconds"); | 28 | nwz_lcdmsg(false, 0, 1, "BACK: quit"); |
29 | sleep(5); | 29 | /* wait for key */ |
30 | int input_fd = nwz_key_open(); | ||
31 | if(input_fd < 0) | ||
32 | { | ||
33 | sleep(2); | ||
34 | return 1; | ||
35 | } | ||
36 | while(1) | ||
37 | { | ||
38 | /* wait for event */ | ||
39 | int ret = nwz_key_wait_event(input_fd, 1000000); | ||
40 | if(ret != 1) | ||
41 | continue; | ||
42 | struct input_event evt; | ||
43 | if(nwz_key_read_event(input_fd, &evt) != 1) | ||
44 | continue; | ||
45 | /* handle quit */ | ||
46 | if(nwz_key_event_get_keycode(&evt) == NWZ_KEY_BACK && !nwz_key_event_is_press(&evt)) | ||
47 | break; | ||
48 | } | ||
49 | nwz_key_close(input_fd); | ||
30 | return 0; | 50 | return 0; |
31 | } | 51 | } |