nuttx/drivers/input/Make.defs
Pavel Pisa ab4890df16
Some checks are pending
Build Documentation / build-html (push) Waiting to run
MemBrowse Memory Report / changes-filter (push) Waiting to run
MemBrowse Memory Report / load-targets (push) Waiting to run
MemBrowse Memory Report / identical (push) Blocked by required conditions
MemBrowse Memory Report / analyze (push) Blocked by required conditions
drivers/input: partial fix of indistinguishable ASCII and special keycodes
As analyzed, the NuttX initial keyboard API design uses event
type KBD_SPECPRESS/KBD_SPECREL to deliver special keys
and KBD_PRESS/KBD_RELEASE to deliver ASCII codes.

But it seems that this design choice has not been followed
in virtio-input, goldfish_events and sim_keyboard designs
and result is that external keyboard special keys events
are mapped to KEYCODE_xxx values which start from 0 and
overlaps with ASCII keys.

The issue is tracked under #19527 number.

This set of changes correct events reporting for mentioned
keyboards to report right event type for special keys.

The solution is only partial at this phase.

Virtual and more complex keyboards usually deliver
key pressures as scancodes (key position on keyboard)
and mapping to ASCII for keys which corresponds to letter
and other similar keys lacks mapping of national alphabets,
second row symbols and switch to capital letter according
to modifiers.

Signed-off-by: Pavel Pisa <pisa@fel.cvut.cz>
2026-07-29 22:51:15 -03:00

151 lines
3.2 KiB
Text

############################################################################
# drivers/input/Make.defs
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
# Don't build anything if there is no support for input devices
ifeq ($(CONFIG_INPUT),y)
# Include the selected touchscreen drivers
ifeq ($(CONFIG_INPUT_TOUCHSCREEN),y)
CSRCS += touchscreen_upper.c
endif
ifeq ($(CONFIG_INPUT_FF),y)
CSRCS += ff_upper.c
endif
ifeq ($(CONFIG_FF_DUMMY),y)
CSRCS += ff_dummy.c
endif
ifeq ($(CONFIG_FF_AW86225),y)
CSRCS += aw86225.c
endif
ifeq ($(CONFIG_INPUT_MOUSE),y)
CSRCS += mouse_upper.c
endif
ifeq ($(CONFIG_INPUT_TSC2007),y)
CSRCS += tsc2007.c
endif
ifeq ($(CONFIG_INPUT_UINPUT),y)
CSRCS += uinput.c
endif
ifeq ($(CONFIG_INPUT_FT5X06),y)
CSRCS += ft5x06.c
endif
ifeq ($(CONFIG_INPUT_ADS7843E),y)
CSRCS += ads7843e.c
endif
ifeq ($(CONFIG_INPUT_MAX11802),y)
CSRCS += max11802.c
endif
ifeq ($(CONFIG_INPUT_MXT),y)
CSRCS += mxt.c
endif
ifeq ($(CONFIG_INPUT_STMPE811),y)
CSRCS += stmpe811_base.c
ifneq ($(CONFIG_INPUT_STMPE811_TSC_DISABLE),y)
CSRCS += stmpe811_tsc.c
endif
ifneq ($(CONFIG_INPUT_STMPE811_GPIO_DISABLE),y)
CSRCS += stmpe811_gpio.c
endif
ifneq ($(CONFIG_INPUT_STMPE811_ADC_DISABLE),y)
CSRCS += stmpe811_adc.c
endif
ifneq ($(CONFIG_INPUT_STMPE811_TEMP_DISABLE),y)
CSRCS += stmpe811_temp.c
endif
endif
ifeq ($(CONFIG_INPUT_CYPRESS_MBR3108),y)
CSRCS += cypress_mbr3108.c
endif
ifeq ($(CONFIG_INPUT_GT9XX),y)
CSRCS += gt9xx.c
endif
ifeq ($(CONFIG_INPUT_BUTTONS),y)
CSRCS += button_upper.c
ifeq ($(CONFIG_INPUT_BUTTONS_LOWER),y)
CSRCS += button_lower.c
endif
endif
ifeq ($(CONFIG_INPUT_KEYBOARD),y)
CSRCS += keyboard_upper.c
CSRCS += virtio_key_decode.c
endif
ifeq ($(CONFIG_INPUT_DJOYSTICK),y)
CSRCS += djoystick.c
endif
ifeq ($(CONFIG_INPUT_AJOYSTICK),y)
CSRCS += ajoystick.c
endif
ifeq ($(CONFIG_INPUT_NUNCHUCK),y)
CSRCS += nunchuck.c
endif
ifeq ($(CONFIG_INPUT_SBUTTON),y)
CSRCS += sbutton.c
endif
ifeq ($(CONFIG_INPUT_SPQ10KBD),y)
CSRCS += spq10kbd.c
endif
ifeq ($(CONFIG_INPUT_KMATRIX),y)
CSRCS += kmatrix.c
endif
ifeq ($(CONFIG_INPUT_KMATRIX_I2C),y)
CSRCS += kmatrix_i2c.c
endif
ifeq ($(CONFIG_INPUT_GOLDFISH_EVENTS),y)
CSRCS += goldfish_events.c
endif
ifeq ($(CONFIG_INPUT_MPR121_KEYPAD),y)
CSRCS += mpr121.c
endif
# Include input device driver build support
DEPPATH += --dep-path input
VPATH += :input
CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)drivers$(DELIM)input
endif