Lines Matching +full:code +full:- +full:0

4  * SPDX-License-Identifier: Apache-2.0
19 DEVICE_DT_DEFINE(DT_INST(0, vnd_input_device), NULL, NULL, NULL, NULL,
27 TC_PRINT("%s: %d %x %d\n", __func__, event_count, evt->code, evt->value); in test_cb()
30 memcpy(&last_events[1], &last_events[0], sizeof(struct input_event)); in test_cb()
31 memcpy(&last_events[0], evt, sizeof(struct input_event)); in test_cb()
39 TC_PRINT("%s: %d %x %d\n", __func__, event_count_no_short, evt->code, evt->value); in test_cb_no_short()
42 memcpy(&last_events_no_short[1], &last_events_no_short[0], sizeof(struct input_event)); in test_cb_no_short()
43 memcpy(&last_events_no_short[0], evt, sizeof(struct input_event)); in test_cb_no_short()
49 zassert_equal(event_count, 0); in ZTEST()
53 input_report_key(fake_dev, INPUT_KEY_3, 0, true, K_FOREVER); in ZTEST()
54 zassert_equal(event_count, 0); in ZTEST()
55 zassert_equal(event_count_no_short, 0); in ZTEST()
57 input_report_abs(fake_dev, INPUT_KEY_0, 0, true, K_FOREVER); in ZTEST()
58 zassert_equal(event_count, 0); in ZTEST()
59 zassert_equal(event_count_no_short, 0); in ZTEST()
64 input_report_key(fake_dev, INPUT_KEY_0, 0, true, K_FOREVER); in ZTEST()
67 zassert_equal(last_events[1].code, INPUT_KEY_A); in ZTEST()
69 zassert_equal(last_events[0].type, INPUT_EV_KEY); in ZTEST()
70 zassert_equal(last_events[0].code, INPUT_KEY_A); in ZTEST()
71 zassert_equal(last_events[0].value, 0); in ZTEST()
72 zassert_equal(event_count_no_short, 0); in ZTEST()
74 /* short press - other key */ in ZTEST()
77 input_report_key(fake_dev, INPUT_KEY_1, 0, true, K_FOREVER); in ZTEST()
80 zassert_equal(last_events[1].code, INPUT_KEY_B); in ZTEST()
82 zassert_equal(last_events[0].type, INPUT_EV_KEY); in ZTEST()
83 zassert_equal(last_events[0].code, INPUT_KEY_B); in ZTEST()
84 zassert_equal(last_events[0].value, 0); in ZTEST()
85 zassert_equal(event_count_no_short, 0); in ZTEST()
90 input_report_key(fake_dev, INPUT_KEY_0, 0, true, K_FOREVER); in ZTEST()
93 zassert_equal(last_events[1].code, INPUT_KEY_X); in ZTEST()
95 zassert_equal(last_events[0].type, INPUT_EV_KEY); in ZTEST()
96 zassert_equal(last_events[0].code, INPUT_KEY_X); in ZTEST()
97 zassert_equal(last_events[0].value, 0); in ZTEST()
101 zassert_equal(last_events_no_short[1].code, INPUT_KEY_X); in ZTEST()
103 zassert_equal(last_events_no_short[0].type, INPUT_EV_KEY); in ZTEST()
104 zassert_equal(last_events_no_short[0].code, INPUT_KEY_X); in ZTEST()
105 zassert_equal(last_events_no_short[0].value, 0); in ZTEST()
107 /* long press - other key */ in ZTEST()
110 input_report_key(fake_dev, INPUT_KEY_1, 0, true, K_FOREVER); in ZTEST()
113 zassert_equal(last_events[1].code, INPUT_KEY_Y); in ZTEST()
115 zassert_equal(last_events[0].type, INPUT_EV_KEY); in ZTEST()
116 zassert_equal(last_events[0].code, INPUT_KEY_Y); in ZTEST()
117 zassert_equal(last_events[0].value, 0); in ZTEST()
121 zassert_equal(last_events_no_short[1].code, INPUT_KEY_Y); in ZTEST()
123 zassert_equal(last_events_no_short[0].type, INPUT_EV_KEY); in ZTEST()
124 zassert_equal(last_events_no_short[0].code, INPUT_KEY_Y); in ZTEST()
125 zassert_equal(last_events_no_short[0].value, 0); in ZTEST()