Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Gyroscope, rewrite GestureDetectListener #25

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

mrtngamper
Copy link

I have modified the GestureDetectListener to behave in a, in my opinion, more natural way (Right click and scroll aren't triggered at the same time anymore, the mouse pointer does not jump around when scrolling, double left clicks are triggered without delay, so dragging is possible immediately, the scrolling issue persists though). Volume up and down now trigger left and right clicks.
I have removed some unused code (e.g. some comments, AbsoluteMouseReports ...) and I am not sure if I should add it back in?

@mvevitsis
Copy link

Does your version work on Android 12? I can't even get the app to open.

@mvevitsis
Copy link

Still crashes.

java.lang.SecurityException: Need BLUETOOTH PRIVILEGED permission: neither user 11486 nor current process has android.permission BLUETOOTH_PRIVILEGED .

@mrtngamper
Copy link
Author

Would you mind providing me the whole stack trace? I am not able to reproduce the crash by myself, because I don't own a physical android 12 device (the app does launch on the emulator (API 31), which unfortunately does not support Bluetooth).

@mvevitsis
Copy link

mvevitsis commented Jan 4, 2023

It doesn't crash anymore and I can verify that basic functionality works.

What are the buttons at the top supposed to do?
P>N
T>G
are not self explanatory.

The Bluetooth icon is also a button, but appears to do nothing. Long pressing it just gives me a toast message with the current Bluetooth status. Maybe it should open Bluetooth settings? Just an idea.

It would also be a good idea to remove unnecessary permissions, especially location:

https://developer.android.com/guide/topics/connectivity/bluetooth/permissions

I will make a pull request (against your fork) with permission fixes now.
Check to ensure it still works on earlier versions of Android. I am not sure it will, because I am checking BLUETOOTH_SCAN (I think scan, connect, and advertise are all the same to the user; it asks for the Nearby Devices permission). Might need to make an if then else to request / check different permissions based on API version.

mvevitsis and others added 10 commits January 3, 2023 16:52
Remove unnecessary permissions
Change which permissions are checked at launch to reflect permissions removed when targeting Android 12
# Conflicts:
#	app/src/main/java/com/github/roarappstudio/btkontroller/SplashScreen.kt
@mrtngamper
Copy link
Author

It should work on Android 10 now. I hope the other changes have not broken the Android 12 compatibility again. I don't exactly know what P/N does either. A dedicated menu for all Bluetooth related settings might actually not be a bad idea.

(Currently the app will always ask for pairing when recovering from standby, and the disconnect button does not seem to work correctly. I will look into these issues later.)

@mvevitsis
Copy link

mvevitsis commented Jan 5, 2023

Latest build crashes. Here is the logcat:

https://docs.google.com/document/d/1oYSM0V74Ny8cYr2K5MWmeJiO80uhOToJZirZ8Ks9FoU/edit?usp=sharing

The interesting bit is:
java.lang.SecurityException: Need android.permission.BLUETOOTH_CONNECT

Shouldn't this be granted when the user accepts Nearby Devices as part of the Bluetooth scan check on the splash screen?

@mrtngamper
Copy link
Author

You could try checking out commit 48f9d11 , which also asks for the connect permission. If that works I can add it back in.

@mvevitsis
Copy link

mvevitsis commented Jan 6, 2023

I cloned the repository and set it to that particular commit. It does not crash, but after accepting the Nearby Devices permission, it does not load the main activity either (stays on a blank screen).

There are no errors in the logcat.

# Conflicts:
#	app/src/main/java/com/github/roarappstudio/btkontroller/SplashScreen.kt
@mvevitsis
Copy link

mvevitsis commented Jan 7, 2023

I can verify that the latest build works.
The only thing I noticed is the 'disconnect' button in the menu doesn't disconnect from the remote device as expected. Or I guess it might, but moving the mouse again just reconnects it.

According to the page on Google play, the P and N has to do with the optional hacker's keyboard app, to make it easier to press certain key combinations. I tried it and not only does it work as expected, but it's pretty great:
https://play.google.com/store/apps/details?id=org.pocketworkstation.pckeyboard

As an aside, I think I prefer the original layout of the upper right menu bar, so I submitted a pull request. This should prevent you from accidentally changing the P/N mode when bringing up the keyboard.

What is autopair even supposed to do? I see no difference with it on or off; I wonder if this is related to the Disconnect issue.

Restore original menu order
@mvevitsis
Copy link

mvevitsis commented Jan 8, 2023

Submitted pull request, see above

Update select_device_activity_menu.xml
@mvevitsis
Copy link

When using a software keyboard with navigation keys (e.g. hacker's keyboard), the menu in Kontroller gains focus and prevents the key press from being sent.

Is there a way to prevent the items in select_device_activity_menu.xml
from gaining focus?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants