简体   繁体   English

如何在蓝牙游戏手柄上重新映射按键

[英]how to remap the keys on a bluetooth gamepad

I have a Bluetooth gamepad that I want to use with my nexus 7 (2013). 我有一个想与nexus 7(2013)一起使用的蓝牙游戏手柄。 It worked great out of the box apart from one snag. 除了一个障碍之外,它开箱即用的效果很好。 The right thumbstickbutton is mapped to back. 右指尖按钮映射到背面。

Thus makes it really difficult to play games like GTA where the right thumbstick is used extensively. 因此,很难玩像《侠盗猎车手》这样的游戏,因为其中广泛使用了正确的指尖。

I tried to use multilanguage keymap redefiner from the play store but it requires you press the key you want to remap but when i do so it goes back out of the menu 我尝试从Play商店使用多语言键盘映射重新定义器,但它要求您按要重新映射的键,但是当我这样做时,它会退出菜单

I loked for resources related to mkr but wasnt able to find anything not even on the listed creator website. 我寻找与mkr相关的资源,但即使在列出的创作者网站上也找不到任何东西。

So i took the plunge and rooted my tablet. 因此,我尝试了一下,将平板电脑扎根。

I wanted to use tincore key remapper but found the help and support lacking on the wiki. 我想使用tincore密钥重新映射器,但发现Wiki上缺少帮助和支持。

Found that the keylayout and keychars were the folders where files pertaining to what physical presses on the gamepad were mapped to (keylayout) and what actions those inputs were mapped too. 发现键盘布局和键盘字符是文件夹,这些文件夹与游戏板上的物理按键所映射的文件(键盘布局)以及这些输入所映射的动作有关。

I mounted system rw and duplicated the generic.kl file (which I found was the one being used by looking at logcat) and was hoping to use this to modify the behaviour of my gamepad I just can't seem to find how to associate my new layout with the gamepad as the only option that is offered in the menu is still default 我挂载了系统rw并复制了generic.kl文件(我发现它是通过查看logcat使用的文件),并希望使用它来修改游戏手柄的行为,但我似乎找不到如何关联我的游戏手柄。菜单中唯一提供游戏手柄作为唯一选项的新布局仍然是默认设置

Looks like I didn't check enough. 看来我没有检查足够。 Did some digging and found this post 做了一些挖掘,发现了这个帖子

http://gustavepate.github.io/blog/20130714/android-keyboard-layout-logitech-tablet-keyboard/ http://gustavepate.github.io/blog/20130714/android-keyboard-layout-logitech-tablet-keyboard/

Seems easy to follow will update with my results 似乎易于遵循的将更新我的结果

if you're on android 5, you need to make SElinux permissive. 如果您使用的是Android 5,则需要允许SElinux。 google around for an app to do this. 谷歌周围的应用程序来做到这一点。 without that, it wont apply alternate Keylayout files. 否则,它将不会应用替代的Keylayout文件。 also make sure your keylayout file has the correct file permissions (just match permissions of all other .kl files in that folder) needless to say this all needs root. 还要确保您的键盘布局文件具有正确的文件许可权(恰好匹配该文件夹中所有其他.kl文件的许可权),不必说这都需要root。

to associate it with the gamepad, you need to get the unique ID of your gamepad. 要将其与游戏手柄相关联,您需要获取游戏手柄的唯一ID。 for example, the file for my Ouya controller i did this with is Vendor_2836_Product_0001.kl 例如,我使用的Ouya控制器的文件是Vendor_2836_Product_0001.kl

if you can get the vendor and product number for your gamepad, then name the file accordingly, and you've got it. 如果您可以获取游戏手柄的供应商和产品编号,请相应地命名文件,就可以了。 you should be able to get this when connecting your device and checking logcat, but a little google-fu will get you an answer as well. 您应该能够在连接设备并检查logcat时获得此信息,但是一点点Google-fu也可以为您提供答案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM