[Q] Mouse tweaks for emulators - Xposed General

Hello all
Im trying to solve the issue that emulators such as Dos Box, ScummVM, UAE etc have when using a real mouse (plugged in with bluetooth or usb). The 2 main problems are the built in android cursor / pointer being displayed on top of the cursor from the emulator, and the mouse not going past the edge of the screen (for things like turning laying games such as doom).
Would this sort of change be possible by creating an Xposed module? Is so, does anyone have any pointers as to which classes i need to be modifying? Im guessing that the edge wrapping issue will be something in the MotionEvent.java class, but no idea about the pointer icon yet.
My end goal would be to create an easily togglabe solution that allows changing between default mouse behaviour, and a modifed style for emulators.
Thanks
Adam

Made some progress with this so far. Got the cursor hiding working. Ive attached the APK of what ive done so far. It works great for hiding the system pointer within ScummVM. To enable this set the pref and reconnect your mouse (turn off and on again). The cursors seem to only be updated when the mouse is connected to the system.
Does anyone have any ideas how to allow things like DosBox to not get stuck on the edge of the screen mouse wise? This is for things like turning in FPS games etc.
Adam

Related

[Q] HP TouchPad Wireless Keyboard Remapping 4 ICS?

I have the Official HP TouchPad Wireless Keyboard and I'm running cm9 0.6
Some keys on the Keyboard are non functional with ICS. For example
Brightness Control
Back and Forward Music
Notification Key
Card View Key (Could be used as home button)
Virtual Keyboard Toggle Key
and some others I cant think of
My point is, how can I make these keys functional to actually work
and
Is there any way someone could probably develop a driver that can be flashed via Clockwork Mod Recovery as a ZIP?
It would be a great help to us TouchPad Users running CM9 ICS
BUMP!
Sent from my Galaxy Nexus using xda premium
I'm actually very curious about this as well, I own the HP touchpad keyboard too and I really like it, it works really well on WebOS but when it came to android, many of the buttons don't work and it would be really great if these buttons could be remapped in some form or another.
Yeah, I would be interested in this too.
Some of the keys are easily fixable by editing /system/usr/keylayout/qwerty.kl - such as the media back/forward buttons. There's a keytest app out there which will capture keystrokes and spit out the numerical codes. You can then edit these codes in together with the desired commands into the kl file.
Other keys (keyboard toggle, brightness toggle etc...), however, do not trigger numerical keycodes at all when pressed; they seem to be using some WebOS specific command, or the Android driver simply is not written to recognise these codes. It looks like the driver would need to be modified for those keys to work - but I am no expert.
I'll try and post an edited kl file with all the keys which are recognised working later.
I have no idea on Android inputs work, but in Linux/X server there was a command line command that allowed you to directly capture keystrokes/events from a keyboard. Does android use X?
Just so you know, this thread will probably get moved, but I thought I would provide a link before it does.
http://forum.xda-developers.com/showthread.php?t=1379863
I havent applied this to CM9, but I would imagine that it shouldn't be too different.
Bump
Bump
Bump
Try using this app:
External Keyboard Helper
https://play.google.com/store/apps/...id.hwkeyboardhelperdemo&feature=search_result
You can use it to remap keys into android. Please report back if it works, as I want to buy a keyboard for my tablet, but dont want to deal with useless keys
I did find this review in the UK that mentions this app does help remap and get those uesless keys working:
http://www.amazon.co.uk/product-reviews/B0058CZX70?pageNumber=2
Quote:
This high quality Bluetooth keyboard measures 28.5cm by 13cm and weighs about 360g, including the two AA batteries that are supplied with it: slightly longer than my tablet is wide, but still small and light enough to carry round.
It is solidly made, matt black metal rather than plastic, with a stylish curving shape firmly supported on rubber feet - no wobble even on slightly uneven surfaces. The slope is perfect for fast typing. The keys are low profile and short-travel, full size, responsive and quiet. No sign that any of them is likey to come loose. There is no numeric keypad, but there is a row of function keys at the top to control the tablet - search, brightness, volume, on/off etc. Battery life is claimed to be about six months as the keyboard powers down when not in use and comes back to life as soon as you press a key.
The keyboard paired with my Sony S and with my Galaxy (both Android devices) without fuss and worked immediately, although three or four key mappings needed adjusting to match the GB layout. For this the External Keyboard Helper app is highly recommended - you just press "autodetect keyboard" and everything comes right.
As other reviewers have mentioned, there is no on/off indicator. The light next to the on/off switch on the underside of the keyboard seems to show that the device is visible for pairing, rather than that it is on. Again, the External Keyboard Helper is useful here because it flashes up a discreet message when a keyboard is not detected. I only found the lack of a light a problem on one occasion - the second time I used it. The batteries supplied were flat, so nothing worked. Fortunately, before hurling it at the wall, I remembered the old principle "check the simplest explanation first".
The lack of a caps lock light I did not find a problem - this probably depends on your style of typing.
Excellent value for money.

Car Installs - Triggering a Tasker Task from Keyboard

Hi,
I am having difficulty getting something I would think easy to work on my Nexus for my car install.
I was wondering how people are getting tasker tasks to be triggered off keyboard hotkeys when using either their Joycon or a standard external keyboard.
It seems from research the way to do this used to be quick launch shortcuts (assigning search key + a letter) to an app or shortcut but it seems these do not work for me in android 4.4?
External keyboard helper lets you launch applications from hotkeys, but seems to give no way of launching tasker tasks.
This is really doing my head in! From youtube it looks like others have no issues doing this. Any help would be greatly appreciated!
Well, the only thing I can think of right now is to use a Tasker Scene with a focused textbox to detect the keys. You will have to run this scene as a dialog, and deal with all the complications with that... (touch disabled outside of dialog, etc) but here's another idea.
You could use a mobile bluetooth keyboard (or any keyboard that has volume/brightness keys) and have a Tasker profile pick up a change in the ringer volume variable, this would give you 2 or 3 hotkeys (vol up, down, or mute). If you don't have a keyboard like that you could edit the Android keymappings under /system/usr/keylayout/General.kl to incorporate volume changes under some key.
Sent from my SCH-I605 using xda app-developers app
Good idea with detecting the variable changes! I'm using an Arduino Micro which emulates a keyboard so I will have no problem emulating them via buttons & changing the keyboard layout kl if nessesary. Thanks
I am currently working on the same topic: Here is my workaround for trigger a task with an external bluetooth keyboard.
create a task in Tasker
create an app of this task with Tasker App Factory
remap a key of the keyboard to the new app with External Keyboard Helper
Finish
Maybe this is helpful
Thomas
What are you trying to accomplish?
Lokifish Marz said:
What are you trying to accomplish?
Click to expand...
Click to collapse
1. With a bluetooth remote (Satechi BT MediaRemote) i want to switch between the homescreen by pushing a key. (launcher nova and tasker secure settings are necessary)
2. a tasker scenes (dialog) with different options should open by pushing another key. Navigation in the scene should do also with the Bluetooth remote (not yet finish).
The goal is an intuitive handling of the tablet ui in the car with less touch-input on the screen. Something like Audi MMI or BMW idrive.
In my opinion to find icon on the homescreen while driving is difficult.
Here is my current set up.
Nexus 7 (In dash)
Center console mounted volume dial with push to mute (Tablet>dial>amp)
(Not shown in the screencap is that the media widget is also in the Navbar and accessed via a softkey in the navbar)
The console dial was initially a USB 5 button mouse with key remapping but required the amp gain be cranked up which caused issues.
Now for full control you need the following;
(Some of these things can be eliminated with voice controls)
Media Control (Previous, Play/Pause, Next, Playlist, etc.)
Directional controls (Up, Down, Left, Right)
Action Controls (Select, Home, Back, Recent, Menu)
Phone Control (Answer, Hangup, Dialpad)
SMS Control (Full KB or voice to text using a noise canceling mic)
If you skip voice control and you don't count the dialpad or KB, you need 15 buttons or adaptive input based on what app is running but still need at least 5-6 buttons. I am not sure how involved implementation of adaptive input would be as I gave up after days of trying to get it just right.
With the Satechi BT MediaRemote, you can cover most of this by key remapping but have to remember what keys are what. The advantage of proper key remapping is that it removes the need for additional apps to get it to work.
Seeing that I'm not sure how complete of a setup you are trying to get, it's hard to offer anymore advice.

Glass Mouse

Thanks to jtxdriggers' glass launcher, I have been able to install and launch a number of legacy android apps on my glass. Unfortunately since xe12+ the touchpad no longer allows us to change focus in these apps which makes them pretty limited. Right now I am using a usb Favi keyboard to 'tab' through different elements to regain some control over legacy apps. In most cases this works fairly well.
There are some elements however that are not selectable through tab, and a mouse would be pretty useful. However, all I can get out of the touchpad of my favi is cursor movements. I've also installed synergy, and although the keyboard support works great, again the mouse cursor moves but no clicks ever make it to ui elements.
When I connect through adb and call a getevent -l, I can see that both the favi and synergy create new /dev/input/event# to control the mouse. I can also see left_btn and right_btn down and up events firing as well as scroll wheel events and cursor movement events. This leads me to believe that the drivers for the mouse is installed and working properly.
It appears to me that there is some disconnect between the system events of a mouse click and the UI event listeners. What I don't know is where those two meet up in the system. Any direction or advice from here would be greatly appreciated.

xbox one s controller layout

I installed the magisk x box one S controller module so I can connect the controller via Bluetooth. This portion works. The phone sees the controller and I can link the two. However, I have no control of my first-person shooter. There was a button or two that worked, but the joysticks didn't work. There was basically no functionality.
On my homescreen the joysticks and dpad DID move around and highlight apps. I could then press a button- "A" I think- and this would open the app just like I had tapped on it. So the phone is seeing the controller and it seems like the module itself is probably working as advertised. Is there something I have to do to link the controller inputs to taps and swipes on my controller screen so this factions properly? Are there layout files somewhere that I can download and copy to specific directories?

help binding keyboard buttons and mouse to set area on screen

Hi thanks in advance for the help essentially im trying to bind certain key strokes to act like i touched an area of the screen and set a lock a mouse to a set location and make it seem like when i move me mouse im directing a thumpad in the direction of the mouse movement. i know that certainly possible here is why im struggling . i do not need this to be set in a game but rather on the touch screen of my toUCH monitor for my laptop si u can use dex to open a phone app and set on my pc to act like im touching the screen when using it . i have tried everything but cannot figure this out sorry for my english

Categories

Resources