Lines Matching +full:input +full:- +full:event +full:- +full:codes
4 * SPDX-License-Identifier: Apache-2.0
10 #include <zephyr/dt-bindings/input/keymap.h>
11 #include <zephyr/input/input.h>
12 #include <zephyr/input/input_keymap.h>
20 const uint16_t *codes; member
35 const struct keymap_config *cfg = dev->config; in keymap_cb()
36 struct keymap_data *data = dev->data; in keymap_cb()
37 const uint16_t *codes = cfg->codes; in keymap_cb() local
40 switch (evt->code) { in keymap_cb()
42 data->col = evt->value; in keymap_cb()
45 data->row = evt->value; in keymap_cb()
48 data->pressed = evt->value; in keymap_cb()
52 if (!evt->sync) { in keymap_cb()
56 if (data->row >= cfg->row_size || in keymap_cb()
57 data->col >= cfg->col_size) { in keymap_cb()
58 LOG_WRN("keymap event out of range: row=%u col=%u", data->row, data->col); in keymap_cb()
62 offset = (data->row * cfg->col_size) + data->col; in keymap_cb()
64 if (offset >= cfg->num_codes || codes[offset] == 0) { in keymap_cb()
65 LOG_DBG("keymap event undefined: row=%u col=%u", data->row, data->col); in keymap_cb()
69 LOG_DBG("input event: %3u %3u %d", data->row, data->col, data->pressed); in keymap_cb()
71 input_report_key(dev, codes[offset], data->pressed, true, K_FOREVER); in keymap_cb()
76 const struct keymap_config *cfg = dev->config; in keymap_init()
78 if (!device_is_ready(cfg->input_dev)) { in keymap_init()
79 LOG_ERR("input device not ready"); in keymap_init()
80 return -ENODEV; in keymap_init()
113 .codes = keymap_codes_##inst, \