如何提供独立于平台的键码
sdl 或 java 等跨平台框架如何提供独立于平台的键码。他们有所有可能情况的映射表吗?或者是否有另一种(最终更好)的方法来实现这一目标。
我需要这个,因为我正在开发一个用于(连续)动态击键身份验证的开源框架。我有java小程序、本机linux c和本机windows c++代码形式的客户端。客户端通过网络套接字连接到服务器,并将捕获的击键作为键码发送,并附加一些计时信息到用 c 编写的服务器。我面临的问题是,同一键但来自不同客户端的键码不同。
how do cross platform frameworks like sdl or java provide platform independed keycodes. do they have mapping tables for all possible cases? or is there another (eventually better) way to achieve this.
i need this because i am working on an open source framework for (continuous) dynamic keystroke authentication. i have clients int the form of an java applet, native linux c and native windows c++ code. the clients connect to the server via network sockets and send the captured keystrokes as keycodes with some timing information appended to an server written in c. the problem i'm facing is, that the keycodes for the same key but from different clients differ.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
IME,他们通常定义自己的按键常量并将其放入键盘输入事件结构中(在以特定于平台的方式读取代码之后,这通常对用户隐藏)。 SDL 至少是这样做的。我认为您选择的任何方法都会以某种方式在其核心有一个转换表。翻译发生在哪里(例如,您在客户端还是服务器进行翻译?)取决于您。
IME, they usually define their own key constants and place those into their keyboard input event structure (after reading the code in a platform specific manner, which is usually hidden from the user). SDL does it this way at least. I think any method you choose will have a translation table at its core in some way or another. Where that translation takes place (e.g. do you translate at the client or the server?) is up to you.