Skip to content

Android: add raw key event support for terminal compatibility#272

Merged
bk138 merged 1 commit intobk138:masterfrom
SashankBhamidi:feature/android-raw-keys-214
Sep 24, 2025
Merged

Android: add raw key event support for terminal compatibility#272
bk138 merged 1 commit intobk138:masterfrom
SashankBhamidi:feature/android-raw-keys-214

Conversation

@SashankBhamidi
Copy link
Contributor

@SashankBhamidi SashankBhamidi commented Sep 14, 2025

Summary

Implements QEMU Extended Key Event protocol support for Android client to address raw key event handling issues, particularly for terminal applications like Termux.

  • Adds Android toggle for enabling raw key events when VNC server supports it
  • Complete XT keycode mapping system for Android KeyEvent codes
  • JNI integration for QEMU Extended Key Events via LibVNCClient
  • Server capability detection with graceful fallback to standard key events
  • Support for critical keys: AltGr, Ctrl+Alt+Del, F1-F12, arrow keys, modifiers

Test Results

  • All 17 unit tests pass (AndroidKeyToXtTest)
  • Java/Kotlin compilation successful
  • Android lint clean for implementation files
  • Follows project coding conventions and contributing guidelines

Technical Details

Uses existing LibVNCClient SendExtendedKeyEvent API (available since 2020). No submodule changes required. Maintains backward compatibility with default setting disabled.

Addresses issue #214.


IssueHunt Summary

Referenced issues

This pull request has been submitted to:


@SashankBhamidi SashankBhamidi mentioned this pull request Sep 14, 2025
@Neustradamus
Copy link

@SashankBhamidi: Nice, thanks!

@SashankBhamidi
Copy link
Contributor Author

SashankBhamidi commented Sep 15, 2025

Lmk if changes needed, will ship as required!

@bk138 bk138 self-assigned this Sep 18, 2025
Copy link
Owner

@bk138 bk138 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pretty neat, some minor comments! thanks for the contribution! ❤️

Copy link
Owner

@bk138 bk138 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some minor requests...

@bk138 bk138 linked an issue Sep 18, 2025 that may be closed by this pull request
SashankBhamidi added a commit to SashankBhamidi/multivnc that referenced this pull request Sep 21, 2025
- Add XT scan code specification link to documentation
- Move hasXtMapping() helper method from production code to test file
- Extend existing OutputEvent constructor instead of adding second one
- Bump database version to 16 with migration for sendRawKeys column
- Add translations for all supported languages (ca, de, es, gl, it, ja, pt, ru, uk, zh, zh-rTW)

Addresses review comments from PR bk138#272.
@SashankBhamidi
Copy link
Contributor Author

@bk138 Addressed 5/8 suggestions. Implemented: XT spec link, moved hasXtMapping() to tests, extended constructor, database version bump, and added translations. Kept unit tests for validation and current int pattern for consistency.

@SashankBhamidi
Copy link
Contributor Author

SashankBhamidi commented Sep 21, 2025

Quick note on translations: These were AI-generated per your suggestion. I don't speak all these languages, I do not guarantee their accuracy.

SashankBhamidi added a commit to SashankBhamidi/multivnc that referenced this pull request Sep 22, 2025
- Replace int xtKeycode with OptionalInt for cleaner code semantics
- Remove AndroidKeyToXtTest.java and related test dependencies
- Update all xtKeycode usage to use OptionalInt.isPresent()/getAsInt()
- Compilation verified successful

Addresses final review feedback from PR bk138#272.
@SashankBhamidi
Copy link
Contributor Author

@bk138 Changes complete! OptionalInt implemented and tests removed as requested. Ready for review, thanks for the feedback!

@SashankBhamidi
Copy link
Contributor Author

SashankBhamidi commented Sep 23, 2025

@Iey4iej3 @bk138 Once this is merged, could either one of you accept my PR on IssueHunt so the funds get released to me by rewarding my PR (the issue must not be closed before rewarding)? Thanks!

https://oss.issuehunt.io/r/bk138/multivnc/issues/214

@bk138
Copy link
Owner

bk138 commented Sep 23, 2025

@SashankBhamidi almost there! Thanks for your patience!

SashankBhamidi added a commit to SashankBhamidi/multivnc that referenced this pull request Sep 23, 2025
- Change database migration to use BOOLEAN instead of INTEGER for sendRawKeys
- Remove useExtended field, use only OptionalInt.isPresent() for cleaner design
- Add authoritative specification links: RFC 6143 for RFB protocol and vncdotool for QEMU Extended Key Event protocol
- Simplify OutputEvent constructor by removing useExtended parameter

All changes compile successfully. Addresses final review comments from PR bk138#272.
@SashankBhamidi
Copy link
Contributor Author

@Iey4iej3 @bk138 Once this is merged, could either one of you accept my PR on IssueHunt so the funds get released to me by rewarding my PR (the issue must not be closed before rewarding)? Thanks!

https://oss.issuehunt.io/r/bk138/multivnc/issues/214

Since merging this PR will automatically close the issue, I think it’s better to reward the PR on IssueHunt before merging.

@bk138
Copy link
Owner

bk138 commented Sep 24, 2025

@bk138 bk138 closed this in efe1e2d Sep 24, 2025
@SashankBhamidi
Copy link
Contributor Author

  • Added some changes to your PR @SashankBhamidi, will merge from my local branch.

@bk138, I thought you were going to merge this PR along with your commits. Closing instead of merging affects my GitHub stats.

@bk138
Copy link
Owner

bk138 commented Sep 24, 2025

@SashankBhamidi Sorry. I don't know how to put commits into your branch/PR other than doing that locally. Do you have docs/info on that for next time?

@SashankBhamidi
Copy link
Contributor Author

@SashankBhamidi Sorry. I don't know how to put commits into your branch/PR other than doing that locally. Do you have docs/info on that for next time?

For future reference, you can push to contributor branches:

git remote add contributor https://github.com/SashankBhamidi/multivnc.git
git push contributor master:feature/android-raw-keys-214

Then merge the updated PR normally.

Docs: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/about-permissions-and-visibility-of-forks

@SashankBhamidi
Copy link
Contributor Author

@bk138 Could you reopen and merge PR #272? I've force pushed an empty commit so this PR can get merged. "Merged" vs "Closed" status is important for my GitHub contribution stats since I use them for freelancing gigs.

Note: Merging this empty PR won't modify any files since all the actual changes are already in master - this is just to fix the PR status from "Closed" to "Merged".

@bk138 bk138 reopened this Sep 24, 2025
@bk138
Copy link
Owner

bk138 commented Sep 24, 2025

@SashankBhamidi get your point. There are merge conflicts now, maybe add a single new commit improving some indentation or the like.

@SashankBhamidi SashankBhamidi force-pushed the feature/android-raw-keys-214 branch from d808706 to 6165281 Compare September 24, 2025 11:04
@SashankBhamidi
Copy link
Contributor Author

@bk138, my bad, forgot to reset with upstream before pushing an empty commit. Ready for merge.

@bk138 bk138 merged commit 782190c into bk138:master Sep 24, 2025
2 of 3 checks passed
@SashankBhamidi SashankBhamidi deleted the feature/android-raw-keys-214 branch September 24, 2025 13:23
@SashankBhamidi
Copy link
Contributor Author

Thanks! Will get to issue #216 shortly.

@Neustradamus
Copy link

@SashankBhamidi: Good job, thanks!

@SashankBhamidi
Copy link
Contributor Author

@bk138 mind if I ask you about the steps you used to reward me? I’m running into an issue with another bounty where my PR isn’t being rewarded, and I’m not too familiar with the process. If you could walk me through it quickly, I’d really appreciate it!

Reference: OpenRefine/OpenRefine#7432 (comment)

@bk138
Copy link
Owner

bk138 commented Sep 28, 2025

@bk138 mind if I ask you about the steps you used to reward me? I’m running into an issue with another bounty where my PR isn’t being rewarded, and I’m not too familiar with the process. If you could walk me through it quickly, I’d really appreciate it!

Reference: OpenRefine/OpenRefine#7432 (comment)

The issuehunt page shows funded issues per project, once there is a PR a "reward" button appears, this is how i did it for this issue. It can be that projects need to be added to issuehunt by the maintainer manually; there is an "Add Repository" button in the upper right.

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.

Sending Raw Keys

3 participants