首发平台:微信公众号baiwenkeji 很多人在做触摸屏驱动实验,移植tslib库时,可能会出现错误提示“selected device is not a touchscreen I understand absbit & (1 << ABS_Y)) && (absbit & (1 << ABS_PRESSURE)))) { fprintf(stderr, “selected device is not a touchscreen using_syn = 1; return 0; } 其中关键的是version == EV_VERSION这个判断语句,如果这俩不等,那么就会打印出selected device is not a touchscreen
\goodix.txt drivers/input/touchscreen/goodix.c Linux 4.x内核 Documentation\devicetree\bindings\input \touchscreen\goodix.txt drivers/input/touchscreen/gt9xx/gt9xx.c 设备树 IMX6ULL:Linux-4.9.88/arch/arm/ = <5>; touchscreen-size-x = <800>; touchscreen-size-y = <480>; touchscreen-max-w = <1024>; touchscreen-max-p = <1024>; /*touchscreen-key-map = <172>, <158>;*/ /*KEY_HOMEPAGE, KEY_BACK*/ = <5>; touchscreen-size-x = <1024>; touchscreen-size-y = <600>; }; }; 3.
触摸屏校准当触摸不准时,需修改/etc/udev/rules.d/touchscreen.rules文件,此文件为校准参数存放位置,默认参数支持我司7寸MIPI DSI屏。 #SUBSYSTEM=="input",KERNEL=="event[0-9]*", ENV{ID_INPUT_TOUCHSCREEN}=="1",ENV{LIBINPUT_CALIBRATION_MATRIX [libinput]# Uncomment below toenable touch screen calibrator(weston-touch-calibrator)touchscreen_calibrator weston-touch-calibrator获取到校准参数“-0.000121-0.956017 0.980913 1.010802 0.014924 -0.028297”后,将其填入/etc/udev/rules.d/touchscreen.rules 文件中,修改如下:SUBSYSTEM=="input",KERNEL=="event[0-9]*", ENV{ID_INPUT_TOUCHSCREEN}=="1",ENV{LIBINPUT_CALIBRATION_MATRIX
GPIO_Pin_0#define TouchScreen_GPIO_Port GPIOA#define Button_Pin GPIO_Pin_0#define Button_GPIO_Port GPIOA // 函数声明void SystemInit(void);void LED_Blink(void);void TouchScreen_Init(void);void Button_Init(void); ()) // 检测触摸屏是否被触摸 { TouchScreen_Process(); // 处理触摸屏事件 } if (Button_Read ; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU; // 设置为上拉输入模式 GPIO_Init(TouchScreen_GPIO_Port, & (void){ return GPIO_ReadInputDataBit(TouchScreen_GPIO_Port, TouchScreen_Pin);}void TouchScreen_Process
product>" EndSection 其中的 touchscreen product 可以从 /var/log/Xorg.0.log 得到。 上下相反 如点击 左上角 却反馈在 左下角 ,在 90-touchscreen-calibrator.conf 中加上 Option InvertY "true" 。 左右相反 如点击 左上角 却反馈在 右下角 ,在 90-touchscreen-calibrator.conf 中加上 Option InvertX "true" 。 XY 相反 如点击 左上角 却反馈在 右上角 ,在 90-touchscreen-calibrator.conf 中加上 Option SwapAxes "true" 。 持久化 可添加 90-touchscreen-map 到 /etc/X11/xinit/xinitrc.d 目录,内容就是上面的命令。
setContentView(R.layout.main); spark(); } private int clo = 0; public void spark() { final TextView touchScreen runOnUiThread(new Runnable() { public void run() { if (clo == 0) { clo = 1; touchScreen.setTextColor (Color.TRANSPARENT); // 透明 } else { if (clo == 1) { clo = 2; touchScreen.setTextColor (Color.RED); } else { clo = 0; touchScreen.setTextColor(Color.GREEN); }
mDownTime, mDownTime, MotionEvent.ACTION_DOWN, x, y, 0); event.setSource(InputDevice.SOURCE_TOUCHSCREEN mDownTime, eventTime, MotionEvent.ACTION_UP, x, y, 0); event.setSource(InputDevice.SOURCE_TOUCHSCREEN mDownTime, eventTime, MotionEvent.ACTION_MOVE, x, y, 0); event.setSource(InputDevice.SOURCE_TOUCHSCREEN
android.hardware.bluetooth fl=0x0} I/MainActivity(13514): dumpSystemFeatures fFeatureInfo{40d755b0 android.hardware.touchscreen.multitouch.distinct feature:android.hardware.telephony feature:android.hardware.telephony.gsm feature:android.hardware.touchscreen feature:android.hardware.touchscreen.multitouch feature:android.hardware.touchscreen.multitouch.distinct feature:android.hardware.touchscreen.multitouch.jazzhand feature:android.hardware.usb.accessory feature
keyboard mouse touchpad gamepad touchnavigation joystick touchscreen stylus trackball The commands and default sources are: text <string> (Default: touchscreen (Default: keyboard) tap <x> <y> (Default: touchscreen) swipe <x1> <y1> <x2> <y2> [duration (ms)] (Default: touchscreen) draganddrop <x1> <y1> <x2> <y2> [duration(ms)] (Default: touchscreen
touchnavigation mouse keyboard gamepad touchpad dpad stylus touchscreen The commands and default sources are: text <string> (Default: touchscreen) keyevent [-- (Default: keyboard) tap <x> <y> (Default: touchscreen) swipe <x1> <y1> <x2> <y2> [duration (ms)] (Default: touchscreen) press (Default: trackball) roll <dx> <dy> (Default: trackball
https://download.csdn.net/download/du2005023029/11855968 GT911驱动 gt9xx文件 夹放在Linux 源码 drivers/input/touchscreen 下 修改drivers/input/touchscreen Makefile obj-$(CONFIG_TOUCHSCREEN_GOODIX) += gt9xx/ 2. drivers —> Input device support —> [*] Touchscreens —> <*> Goodix I2C touchscreen
keyboard mouse touchpad gamepad touchnavigation joystick touchscreen stylus trackball The commands and default sources are: text <string> (Default: touchscreen (Default: keyboard) tap <x> <y> (Default: touchscreen) swipe <x1> <y1> <x2> <y2> [duration (ms)] (Default: touchscreen) draganddrop <x1> <y1> <x2> <y2> [duration(ms)] (Default: touchscreen
keyboard joystick touchnavigation touchpad trackball stylus dpad touchscreen gamepadThe commands and default sources are: text <string> (Default: touchscreen) keyevent (Default: keyboard) tap <x> <y> (Default: touchscreen) swipe <x1> <y1> <x2> <y2> [duration( ms)] (Default: touchscreen) press (Default: trackball) roll <dx> <dy> (Default: trackball)操作示例如下
提高屏幕亮度 223 系统休眠 224 点亮屏幕 231 打开语音助手 276 如果没有 wakelock 则让系统休眠 2.点击屏幕 # 点击屏幕坐标(x, y) adb shell input touchscreen tap {x} {y} # 例 adb shell input touchscreen tap 100 100 3.滑动屏幕 # 从(x1, y1)滑动到(x2, y2) adb shell input touchscreen swipe {x1} {y1} {x2} {y2} # 例 adb shell input touchscreen swipe 100 150 100 100 5.截图,录制屏幕
display-coords = <0 0 800 480>; focaltech,reg_vdd = <0x0000001f>; focaltech,reg_avdd = <0x0000001f>; #touchscreen-inverted-x = <0x00000001>; #touchscreen-inverted-y = <0x00000001>; }; }; 确保其中引脚与前面硬件了解中的一致。 驱动文件: lichee/linux-5.4/drivers/input/touchscreen/focaltech_touch/focaltech_core.c 修改xy坐标返回值: # 默认: 选择:Kernel modules > Input modules -> kmod-input-core[*] 选择:Kernel modules > Input modules -> kmod-touchscreen-focaltech 内核配置修改: make kernel_menuconfig 选择:Device Drivers > Input device support > Touchscreens -> Focaltech Touchscreen
论文:https://userinterfaces.aalto.fi/touchscreen-typing/resources/touchscreen_typing_as_optimal_adaptation.pdf 参考资料: https://techxplore.com/news/2021-05-ai-humans.html https://userinterfaces.aalto.fi/touchscreen-typing /resources/touchscreen_typing_as_optimal_adaptation.pdf https://userinterfaces.aalto.fi/how-we-type-mobile
mLocaleList = LocaleList.getEmptyLocaleList(); locale = null; userSetLocale = false; touchscreen = TOUCHSCREEN_UNDEFINED; keyboard = KEYBOARD_UNDEFINED; keyboardHidden = KEYBOARDHIDDEN_UNDEFINED
其它各种鼠标驱动,包括PS2鼠标、I2C鼠标、触摸板等 [ ] PS/2mouse 通过.config文件的内容来裁剪 通过vi .config,找到如下图所示,由于CONFIG_TOUCHSCREEN_USB 最后通过上节查找的裁剪内容,来make menuconfig 去掉CONFIG_TOUCHSCREEN_USB -> Device Drivers Input device support -> Generic input layer -> Touchscreens <*> Samsung S3C2410/generic touchscreen input driver //加上自带的触摸屏驱动 < > USB Touchscreen Driver
_018_005/adc_touchscreen 我们在adc_touchscreen目录下添加几个文件 touchscreen_test.c touchscreen.c 我们打开touchscreen.c /adc.o objs += adc_touchscreen/adc_test.o objs += adc_touchscreen/touchscreen.o objs += adc_touchscreen touchscreen_test(); while (1); return 0; } 进入touchscreen_test.c文件执行init初始化程序 void touchscreen_test (void) { touchscreen_init(); } 进入touchscreen.c文件 void touchscreen_init(void) { /* 设置触摸屏接口:寄存器 /adc.o objs += adc_touchscreen/adc_test.o objs += adc_touchscreen/touchscreen.o objs += adc_touchscreen
获取系统屏幕的方向:ORIENTATION_LANDSCAPE(横向屏幕),ORIENTATION_PORTRAIT(竖向屏幕),ORIENTATION_SQUARE(方形屏幕) public int touchscreen 系统触摸屏的触摸方式:TOUCHSCREEN_NOTOUCH、TOUCHSCREEN_STYLUS(触摸笔式触摸屏)、TOUCHSCREEN_FINGER