Lines Matching +full:code +full:- +full:1
4 * SPDX-License-Identifier: Apache-2.0
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()
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()
52 input_report_key(fake_dev, INPUT_KEY_3, 1, true, K_FOREVER); in ZTEST()
56 input_report_abs(fake_dev, INPUT_KEY_0, 1, true, K_FOREVER); in ZTEST()
62 input_report_key(fake_dev, INPUT_KEY_0, 1, true, K_FOREVER); in ZTEST()
66 zassert_equal(last_events[1].type, INPUT_EV_KEY); in ZTEST()
67 zassert_equal(last_events[1].code, INPUT_KEY_A); in ZTEST()
68 zassert_equal(last_events[1].value, 1); in ZTEST()
70 zassert_equal(last_events[0].code, INPUT_KEY_A); in ZTEST()
74 /* short press - other key */ in ZTEST()
75 input_report_key(fake_dev, INPUT_KEY_1, 1, true, K_FOREVER); in ZTEST()
79 zassert_equal(last_events[1].type, INPUT_EV_KEY); in ZTEST()
80 zassert_equal(last_events[1].code, INPUT_KEY_B); in ZTEST()
81 zassert_equal(last_events[1].value, 1); in ZTEST()
83 zassert_equal(last_events[0].code, INPUT_KEY_B); in ZTEST()
88 input_report_key(fake_dev, INPUT_KEY_0, 1, true, K_FOREVER); in ZTEST()
92 zassert_equal(last_events[1].type, INPUT_EV_KEY); in ZTEST()
93 zassert_equal(last_events[1].code, INPUT_KEY_X); in ZTEST()
94 zassert_equal(last_events[1].value, 1); in ZTEST()
96 zassert_equal(last_events[0].code, INPUT_KEY_X); in ZTEST()
100 zassert_equal(last_events_no_short[1].type, INPUT_EV_KEY); in ZTEST()
101 zassert_equal(last_events_no_short[1].code, INPUT_KEY_X); in ZTEST()
102 zassert_equal(last_events_no_short[1].value, 1); in ZTEST()
104 zassert_equal(last_events_no_short[0].code, INPUT_KEY_X); in ZTEST()
107 /* long press - other key */ in ZTEST()
108 input_report_key(fake_dev, INPUT_KEY_1, 1, true, K_FOREVER); in ZTEST()
112 zassert_equal(last_events[1].type, INPUT_EV_KEY); in ZTEST()
113 zassert_equal(last_events[1].code, INPUT_KEY_Y); in ZTEST()
114 zassert_equal(last_events[1].value, 1); in ZTEST()
116 zassert_equal(last_events[0].code, INPUT_KEY_Y); in ZTEST()
120 zassert_equal(last_events_no_short[1].type, INPUT_EV_KEY); in ZTEST()
121 zassert_equal(last_events_no_short[1].code, INPUT_KEY_Y); in ZTEST()
122 zassert_equal(last_events_no_short[1].value, 1); in ZTEST()
124 zassert_equal(last_events_no_short[0].code, INPUT_KEY_Y); in ZTEST()