Hey guys,
I work for an IPTV provider and we decided to ship out some of those S905 boxes to be used as STB's. We have a third party writing the app to access our service, it works great with classic STB's, but the Android version only accepts touch screen input. We can cheat it by swiping with an air mouse. I am trying to remap a couple of keys on the air mouse remote controls to act as swipe gestures (which also change channels), so we can ship those boxes with updated key maps, while we wait for the developer to fix the Android app code.
Specific questions:
1) Is there a way to make a key map, app-specific? So that the system only applies the key map when the app is open and goes back to the default key map for the device for everything else?
2) Is there something like evtest for Android that will capture input and also give me key codes? (that will make re-mapping the keys a lot easier lol)
TIA for any help you can give me. If this is not the right forum for this, please point me there.
Related
I was impressed by the way the mouse cursor is controlled in the Remote Desktop application called "Xtralogic Remote Desktop Client for Android"
It uses what I am referring to here as "touch based relative cursor control" to allow you to control the mouse movements when connected to your remote desktop PC.
"Touch based relative cursor control" means that where ever you touch the screen, you are moving the mouse. Its basically like layering a transparent touchpad on top of the screen. Your finger doesn't have to be right on top of the cursor for it to work...
here is a video from their website to illustrate what i'm talking about:
I think that this could be very handy for certain things in android like browsing the internet.
the folks over at android-x86.org already have the code to add cursor support to android, their source code is freely available.
so here is what I would like to see:
-relative touch cursor
-for use in android browser (or other parts of the OS)
-while in browser, can be controlled via some sort or swiping gesture, menu option, or triple clicking
I just wanted to get a feeling on how the xda community would be open to such an idea, and maybe see if it sparks the interest of any devs (since my android coding skills are relativity limited at the moment.).
Good idea, but you're not the first to mention this.. i just hope some one make this happen
This would be great as an option for interacting with flash apps that rely on mouse hover.
With the release of the Xperia Play specifically, it'd be nice if we had a way to create system wide, and per-program hotkeys.
For example, the camera app has X mapped as the shutter button. With this program we could set it so when the camera app is running, that R will take a picture (so we can do it with the camera closed) and in the home menu, pressing L and R together will open the camera program.
Some games/apps are programmed to let us map buttons, but very few use the analog touchpad. It'd be nice if we could map the different directions to different keys, so we could get rudimentary support for them in existing apps.
Now for those apps that dont use buttons at all, it could send touchscreen presses to them. You'd need a way to do this within the app itself so you could see where you're going to press it. Perhaps via a something (a widget?) in the notification slider, that takes a screenshot and brings up the menu, to let you select the X/Y coordinate to send. This would work great for the touchpad and virtual on-screen analog sticks
Now I can understand if you guys dont want to waste your time, but if you can provide me the necessary API, when I get the hang of Android development I could do it in time. Assuming it works like Windows, I'd need equivalent API to:
-listen for key presses even when the app is not in focus
-detect which app is in focus
-send artificial key/touchscreen events to that app
-take a screenshot of that app
Also, if you can provide the API to run the current Live Wallpaper in the background, it would help for another project I'd like to do.
Great project, with i could help you out. But i dont understand a thing about programming
Hello everybody,
I have an Iconia A500, running with Jelly Bean / rooted, Cyanogenmod 4.1.2 from Randomblame.
So far so good. As most of you know, this device supports bluetooth mice and USB mice. I am using both kinds of mice quite often for working in office tools or for the good old ScummVM games.
Now to my question. Every mouse I use only has the left click function. Right click does the same as left click. Is there a possibility to configure the right button? In Office I would like to get the "long press" instead, in the ScummVM Games I would like to get the "default action", wich is highlighted on touch.
I dont mind if I can configure directly in Android or if I have to use an app. I would be glad for any idea which could help.
Thank you!
I don't think you can get right click of the mouse on the phone, because if you connect the mouse your clicks (any button) simply translates into "touches". As "left" and "right" is not something about "touching" the screen. I tested this on Nexus 7 (where you just plug mouse and get black mouse cursor visible on the screen) -- no one app didn't react on "right click" or "mouse over" (no a button to highlight). You can click and drag - that is ok and no problems. You can mimic any touch action, but i didn't notice event implementation for mouse specific staff.
greenyadzer said:
I don't think you can get right click of the mouse on the phone, because if you connect the mouse your clicks (any button) simply translates into "touches". As "left" and "right" is not something about "touching" the screen. I tested this on Nexus 7 (where you just plug mouse and get black mouse cursor visible on the screen) -- no one app didn't react on "right click" or "mouse over" (no a button to highlight). You can click and drag - that is ok and no problems. You can mimic any touch action, but i didn't notice event implementation for mouse specific staff.
Click to expand...
Click to collapse
Hey,
thank You already. For my Iconia it's the same. Just plug in the USB Adapter or connect the Bluetooth device and it's running with this black arrow. But theoretically it should be possible to get different actions by different buttons. The mice are sending the signals for right and left button (Windows PC detects it). Only Android is just configured to understand them all as "left" (In previous Android Versions the right button often was configured to "back").
What I need is something, which defines my right button as long press or something else - similar to the Logitech Setpoint software for PC (There you also can set shortcuts, Keyboard Combinations or whatever for nearly every button). I am sure, I am not the first one thinking about this, so isn't there any app/driver/trick to get this working?
I guess i can't give you concrete answer or tip here.
I am only wonder if they had support for all mouse stuff in previous Androids, why they decided to remove it from 4.1
...
technically I think it is possible that right click work under some kernels the version before last of es explorer used to work with right click like in windows but now does not... I have a XOOM runnig team eos 3 stable release
Plenty of Remote Desktop software can "decode" right click so obviously right click and left click are registered differently from android but as android lacks "right-click functionality" (it) replaces both as a left click (touch) trigger. The trick would be to replace "long touch" for right click.
To those who have bought (for example) a Note 12.2 tablet for samsung, plugging in a mouse and using "Hancomm office" would turn the tablet into an ideal laptop. After all it's big enough and now that the software is pouring in I see no reason why should Google (or at least a ... hack) won't give us proper right click. Long click is tedious for any serious consideration...
In Android every app has a menu, some devices like the Galaxy S3/4 have a hardware menu button, hitting right button could emulate the hardware menu button (it does have a specific key code, it can be opened from keyboard), or it could be used as a back like on old versions of Android (makes sense, you "enter" with left and "go back" with right), or it could easily emulate a "reasonably long" click (2.1 secs) or any keypress. The only thing that does not have *ANY* sense is making it equal to the left button like on recent Android. That's already there, no value added. If only someone could make an App to configure that choice...
Samsung Roms
I was using Samsung Roms before where when the bt mouse was connected the right button was acutaly define with "Back" and the middle mouse or mouse wheel was getting me "home".
However when I swiched to CM 12.1 the feature was not there, but as you describe left and right mouse are doing the same and mouse wheel is activating the search menu.
I haven't found any settings for that.
But I would be interested in any input on that regard.
Cheers
Joe
Today I’m going to bring a little bit of magic to your Wear OS watch.
As you know from the earlier post, Android Pie has introduced a new public API for using your Android device as a Bluetooth HID Device (e.g. mouse, keyboard, gamepad, etc.), so I built a simple app that demonstrates one of the possible ways you can use this API. Also, see below for a little surprise regarding compatibility...
So, you have probably already guessed from the title what the app does: it allows you to control the mouse pointer simply by waving your hand. It is compatible with any Windows, OSX, Linux (including Raspbian), Chrome OS, Android (including Android TV) device, as long as it has a Bluetooth radio; no root, no “server” software required. Just launch the app, perform Bluetooth pairing, and then you’ll be able to:
Use it as an intuitive pointer for presentations (and also click through the slides using cursor keys);
Play Fruit Ninja with your arms (e.g. by sideloading it on Android TV, or installing it on a Chromebook from the Play Store);
Control a media player from the sofa (e.g. when using a computer connected via HDMI);
Use it as a VR controller in some Cardboard games to walk around (not for Daydream though, since it has its own controller);
Impress your friends with some telekinetic powers.
Control your DeX-connected phone;
Download
Play Store
Source (Note: the source code doesn't include the Oreo hack)
How to use it
The app features three input modes: air mouse, cursor keys and keyboard input.
The air mouse mode is pretty straightforward. It has two on-screen buttons for left and right click, a top drawer to adjust motion tracking for the way you’re wearing your watch (on your left wrist, on your right wrist, or holding it in your hand like a laser pointer), and a bottom drawer for some extra functions: click and hold (a.k.a. Fruit Ninja mode) and middle click. If your watch is equipped with a rotating crown, you can use it for scrolling as well.
The cursor keys mode is simple enough: tap on the sides of the screen to trigger corresponding keys, double-tap in the center to trigger the Enter key, long-press to quit, and there are also swipe gestures for Escape, Backspace, Space and Tab keys.
Finally, the keyboard input mode allows using either an on-screen keyboard, or voice input. Note, though, that the text you’ll see entered on your connected device depends on your keyboard layout. Only US English is supported at the moment (I can add some more, but that will require you to manually switch the layout both in the app and on the device every time).
If your watch has some extra keys, you can use those to quickly switch between the input modes.
There are also some settings available. You can choose to stabilize the pointer movements (this will smooth out smaller motions like hands shaking), enable diagonal movements for the cursor keys (which is useful for those Cardboard games), or reduce the data rate (which is helpful when you use the app with some older Nougat-based Android TV box, and the mouse pointer just can’t keep up).
A word on compatibility.
Like I said, the API was made public in Android Pie, but (as a belated Christmas present) the app will work on any watch running Oreo as well. That is, when reboot your watch, and after the trippy dots animation you see a big colorful “W” and “Wear OS by Google” instead of the “Android Wear” logo, you should be fine. The API was introduced in Oreo, and it was a bit different (and also hidden) at the time, but before Pie is was only enabled on watches by default. There is a way to enable it on phones as well, but it requires root.
A few tips for troubleshooting.
If you connect and see that the mouse pointer is moving once per second in a really janky way, try turning Airplane mode on your watch on and off, and then reconnect. Looks like there is some occasional issue with power management in the Bluetooth stack…
If you want to adjust the “sensitivity”, please look for the pointer speed setting on the connected device, not in the app itself.
If you are using the app with a device that is connected to a TV, you’ll probably want to switch your TV to the “Game” picture mode. This should turn off any post-processing that may cause a lot of lag on modern TVs.
I also recommend turning off wrist gestures in your watch’s settings when you use the air mouse mode, otherwise there’s a high chance of triggering the “back” or “go home” gesture.
This looks great!
By chance is it possible to have an app that connects to the computer and when it disconnects it locks the PC!
c_86 said:
By chance is it possible to have an app that connects to the computer and when it disconnects it locks the PC!
Click to expand...
Click to collapse
Depends on what you mean.
If you want to make an app that sends Win+L (or Ctrl+Alt+L) when you press "disconnect" on your watch (or maybe connects, sends the key press, then immediately disconnects), then it should be easy enough to implement.
If you mean that the PC should lock itself when your watch disconnects (e.g. goes out of range), then obviously you'll need to have something on your computer to do that. Then again, Windows 10 has a feature called Dynamic Lock that does something similar based on your phone nearby presence.
Idea - Does it possible to implement the same functionality for Smartphone with Android 8? And after that to create Wear app for smartwatches with lower Android version, where the new API is missing - it will act as a remote for the companion app on the smartphone
bobybc said:
Idea - Does it possible to implement the same functionality for Smartphone with Android 8? And after that to create Wear app for smartwatches with lower Android version, where the new API is missing - it will act as a remote for the companion app on the smartphone
Click to expand...
Click to collapse
So, you mean, use a phone connected to a computer (or a TV, our whatever) using this API, then stream motion data from the watch using the phone as a proxy?
Technically it's possible, I wonder what the latency would be though.
Also note that a phone running Android 8 has to be rooted to do this (unlike watches), whereas Android 9 should just work.
Yea, you're right for the lag...
Then i think that it will be useful to have app with the same functionality for a smartphone
Sent from my SM-N960F using Tapatalk
bobybc said:
Yea, you're right for the lag...
Then i think that it will be useful to have app with the same functionality for a smartphone
Click to expand...
Click to collapse
It's not just lag, but power consumption as well.
This API makes use of the low-power mode of the Bluetooth radio called Sniff Sub-Rating (SSR) specifically designed for sending rapid bursts of tiny data packets, whereas watch-to-phone connection would have to be fine in a more generic way.
Making a phone app is really easy, you can pretty much use the same source code, with a few simple changes (mostly deletions). The Android Pie upgrade for your Note 9 is going to arrive pretty soon, which will allow you to experiment with it all you want.
I need the apk since I have a Moto 360 1gen so & cannot look at it on Googleplay
Tincore key mapper is an app to simulate key presses (from a gamepad, keyboard , mouse etc) to touches on the screen. I wanted to play some touchscreen games like MC4 and some classic games via emulators etc by using a gamepad to get a better gaming experience. No matter how good a smartphone is , you can't really enjoy a game as well on it as one would on a proper console or PC using a gamepad etc. This app can really help with this.
The thing is that I was able to make it work and it simulates keypress to a touch on the screen but the touch presses are at all the wrong places. There's an option for auto touch calibration but it didn't fix it and all the touch presses were at the status bar instead of their user defined places. . The only way I was able to make it work was via " manual calibration" by selecting the resolution in the app settings. At least now the touch presses were on different parts of the screen but still not at their user defined places.
Has someone been successful in making the app work correctly ? Or are there better alternatives available ?
Fyi this app needs root and SE to be set to permissive.