问题标签 [input-devices]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
62 浏览

java - 白名单特定输入设备类型

我需要一种方法来检查 KeyEvent 以查看它是什么类型。我想排除除设备(智能手机/表格)自己的硬件/电容按钮之外的所有内容。没有鼠标,没有 BT 键盘或游戏手柄等。我只想与它自己的按钮进行交互。这可能吗?

0 投票
1 回答
2780 浏览

linux - 创建一个类似于 Wacom 的 Linux uinput 设备,用于使用触摸屏和笔

这是一个相当广泛的问题,所以我会尽量集中注意力。

我目前拥有一台安装了 Ubuntu 并具有触摸屏功能的联想笔记本电脑,并拥有一支压力感应蓝牙笔,并试图让这两者作为一款廉价的类似 Cintiq 的平板电脑一起工作。

不幸的是,这支笔只支持 iOS 手机和平板电脑的特定应用程序。
因此,经过大量研究,我设法与笔进行交互并为其创建了一个uinput设备,因此我可以在笔上记录按钮点击和压力变化,甚至在通过输入控制器菜单配置设备时看到它们被路由到 GIMP .

到目前为止,该接口的代码可在此处获得

当尝试用 GIMP 测试它时,麻烦就开始了。
据我所知,这是因为 GIMP 假设 Wacom 设备报告自己的位置,将触摸屏触摸视为鼠标移动,并且一次只允许来自单个设备的输入。

我的问题是,我该如何解决这个问题?

更具体地说,我如何创建一个uinput可以充当 Wacom 平板电脑并取代/阻止我描述的行为的设备?
或者,如果有不同的解决方案,例如修补 GIMP 或为其编写插件。

更新 (2014-06-07)

上面提到的代码现在可以工作了。

我写了一篇关于让它工作的过程的博客文章:http: //gerev.github.io/laptop-cintiq

0 投票
1 回答
1515 浏览

android - 在中断时唤醒安卓手机,在 GPIO 上

在Android开发板上,我试图根据GPIO上收到的中断唤醒AP,有人可以帮我吗?

我对此的理解是:

我们需要创建一个输入设备并根据收到的中断更新一个事件到这个设备。然后从应用程序中,我相信操作系统会发送一个事件发生通知,然后我们需要使用唤醒锁来唤醒 AP。

请让我知道我的理解是否正确?如果是,那你能告诉我需要注册哪种输入设备(EV_PWR,EV_KEY ..),应用程序如何获得通知,我们可以从驱动程序中唤醒AP吗?

0 投票
0 回答
457 浏览

c# - 当前插入了哪些输入和输出设备

我试图弄清楚如何使用 .NET C# 检测某台机器是否插入了扬声器、耳机或麦克风。

我一直在寻找一种可能的方法来实现这一目标,但似乎没有什么对我有用。我遇到了 Microsoft.DirectX 命名空间,后来我写了下一个方法:

可悲的是,上面的示例似乎为我打印了一个驱动程序列表。我通过插入和拔下扬声器和麦克风对其进行了测试,但无论如何打印的设备数量都是相同的。

我想知道是否有更好的方法来跟踪连接到 PC 的设备。

0 投票
0 回答
1009 浏览

android - 如何知道用于打开我的应用程序的输入设备?

我需要知道如何获取用于打开我的应用程序的输入设备(例如在 onCreate 方法中)。

更具体地说,如何知道我的应用程序是使用“Amazon Fire TV Remote Input”还是“Amazon Fire Game Controller Input”打开的?

谢谢!

0 投票
1 回答
8017 浏览

android - Android Touchscreen IDC

I'm struggling with calibration of a touchscreen on Android plataform.

It is an USB Single-Touch Touchscreen from vendor 0dfc and product 0001 as checked with dmesg:

I'm pushing the Vendor_0dfc_Product_0001.idc file /data/system/devices/idc/ (following the documentation from android source - IDC

I got the touch device with all requirements for single touch events:

I also enabled the Pointer Location option from Developer options (Android settings) in order to debug this stage of calibration.

Setup 1

With this setup (1) all the gestures on the touchscreen take place at the up-left corner - just a few pixels left/right/up/down no matter the gesture (swipe). All the touchscreen get events. All the gestures are reversed - when swipe left the pointer goes right; when swipe up, the pointer goes down.

Setup 2

With this setup (2), as expected, it shows a pointer, placed at the position from the last pointer device left (mouse). All the gestures on the touchscreen (no matter the swipe size) keep beaving like setup 1 - move only a few pixels with each swipe event, and with reversed axis.

Setup 3

With this setup (3) the result is the same as setup 2. I just did that to prove that the IDC file is being interpreted correctly.

At this stage, as you can check by now, I have a working IDC file (setup 1) requiring calibration for this touch device.

I tried a lot of combinations from other IDC files (internet samples) and from android source - IDC - ANY OTHER PROPERTY TOOK EFFECT (NOT A SINGLE ONE) - raw.*, output.*, touch.size.*

Does anyone knows how to calibrate properly a touch screen in Android that could guide me in this process?

Thank you

0 投票
1 回答
53 浏览

.net - 使用 .NET 控制输入设备,这可能吗?

我有一个带有各自 .NET SDK 的凝视控制器。

我想知道是否有任何方法可以在 .NET 中创建应用程序/进程,通过代码我可以控制 Windows SO 中的光标移动(和操作:单击、双击......)以及注入文本(在任何地方,例如,重命名图标,在浏览器中进行搜索),基本上我想通过 .NET 中的代码控制输入设备(鼠标、键盘)。

是否可以?我需要什么?从哪儿开始?

对不起,如果这是一个不恰当的问题。

提前致谢。

0 投票
1 回答
7051 浏览

android - 连接到特定 HID 配置文件蓝牙设备

我将蓝牙条码扫描仪连接到我的安卓平板电脑。条形码扫描仪与 android 设备绑定为输入设备 - HID 配置文件。它在系统蓝牙管理器中显示为键盘或鼠标。我发现蓝牙配置文件输入设备类存在但被隐藏。class 和 btprofile 常量在 android 文档中有 @hide 注释。

隐藏类:

http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.3.1_r1/android/bluetooth/BluetoothInputDevice.java

在这里,它们也应该是其他 3 个常量

developer.android.com/reference/android/bluetooth/BluetoothProfile.html#HEADSET

就像

常量很容易通过反射访问。我需要实现的是按隐藏配置文件(INPUT_DEVICE)列出的设备列表。它应该很简单,只需使用以下方法进行小的更改:

developer.android.com/reference/android/bluetooth/BluetoothA2dp.html#getConnectedDevices()

不是用于 A2dp 配置文件,而是用于也通过反射方法访问的隐藏配置文件。可悲的是

不会工作..任何想法我应该如何解决这个问题?我只需要隐藏设备的列表

0 投票
1 回答
1928 浏览

android - 如何使用 GPIO 从挂起中唤醒 Android 嵌入式板

我目前正在将 Android 4.4 (Kitkat) 移植到嵌入式系统(基于 Freescale i.MX6)上。为了开始我的开发,我使用了一些开发套件(Wandboard、Boundary Device 的 BD-SL)。

在处理我的定制板的电源管理时,我毫不费力地将 devkits 置于暂停状态。但是,我找不到如何将它们从睡眠中唤醒(除了重新启动它们)。唤醒系统的预期方法是在 GPIO 上获得中断(例如,基于 Android 的手机上的开关按钮)。

我想知道使用 GPIO 的中断从挂起中唤醒 android 设备的常用方法是什么。虽然这个问题可能看起来微不足道,但我很难从谷歌和专业论坛上的各种搜索中收集我需要的所有信息。我找到了很多信息,但没有任何内容涵盖整个主题。可能是因为我缺少所需的背景,所以如果没有代码示例,我很难将所有内容放在一起。我猜我不是唯一一个处于这种情况的人,因此这篇文章。

以下是我找到的一些信息:

0 投票
1 回答
1838 浏览

android - 安卓蓝牙配对输入设备

我正在尝试通过代码进行配对,它仅适用于普通设备。如果我使用蓝牙扫描仪,它会与之配对,但设备无法工作,直到我进入 android 设置并选择输入设备复选框。我怎样才能通过代码做到这一点?

谢谢你。

这是我的配对代码: