Author Topic: [DONE][Suggestion] Base Touch buttons (RMB/MMB/Ctrl/Alt/Shift alternative on Android)  (Read 904 times)

Offline rkagerer

  • Captain
  • ***
  • Posts: 75
    • View Profile
This is a follow-up to another thread, to document some key screens where it would be helpful on mobile to be able to access functions normally provided by middle-click and right-click.

Namely to check if a particular type of alien is safe to sell or still needed research purposes, whether an item or corpse is a component in known/unknown manufactured items, etc.

They are:
  • "Sell loot" screen right after completing a tactical mission (this would be the most impactful one)
  • Sell screen where you sell items from your base inventory stores
  • Prisoner / Animal / Alien containment list
I'm not sure what the best way would be to provide access.  In most cases I think a long-tap could work (at least for the middle-click function).  Or maybe a hamburger button, mouse button icon(s) like you have in the tactical map, color coding for "still needed" vs. "safe to sell", or something else.

While trying to solve this myself, I even looked for some kind of app that can send keystrokes from a notification drawer widget, with the intent to subsequently bind them somehow to in-game mouse buttons.

I've been playing an X-Com Files campaign on mobile and desktop.  On mobile I find myself reluctant to sell the last of an alien/corpse/etc. after a mission, until I can go to PC and check the tech tree viewer / dependencies list to confirm whether I still need it.  The Auto-Sell Manager helps a lot, but its usefulness is impeded on mobile because you can't check items in the place you really need to (i.e. the post-mission sell loot screen).

Earlier in my game, before I discovered the Auto-Sell Manager, I wound up maintaining big lists like this (it goes on for a few pages...):
« Last Edit: March 30, 2025, 04:20:20 am by rkagerer »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9511
    • View Profile
.
« Last Edit: April 06, 2025, 12:37:32 pm by Meridian »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9511
    • View Profile
Done.

https://github.com/MeridianOXC/OpenXcom/commit/5fd5ff79f66e625bcb386174176030aa2a1c9b3d
(and several other commit after this)

Needs `oxceBaseTouchButtons: true` in options.cfg (is already default on Android).

Click on `Touch` button, then select the action modifier(s) and enjoy.


Test build: https://openxcom.org/oxce/misc/oxce815touch.apk

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9511
    • View Profile
Supported GUIs:
1. sell/sack
2. purchase/recruit
3. transfer items
4. manage alien containment
5. craft crew
6. craft soldier equipment
7. craft soldier armor
8. select new research
9. select new manufacture

Offline rkagerer

  • Captain
  • ***
  • Posts: 75
    • View Profile
This is a great feature, it really improves things on Android.

But I think it's not quite working right on the Transfer Items screen.  I've tried Middle-click and Right-click on Gillman Hero, and nothing comes up.  I can't fully test on desktop at the moment, but am pretty sure it does come up there.  It does come up on desktop.

The other screens I tried so far work fine (including middle- or right-clicking the same item on the Sell/Sack screen).
« Last Edit: April 08, 2025, 01:20:41 am by rkagerer »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9511
    • View Profile
But I think it's not quite working right on the Transfer Items screen.  I've tried Middle-click and Right-click on Gillman Hero, and nothing comes up.  I can't fully test on desktop at the moment, but am pretty sure it does come up there.  It does come up on desktop.

The code is the same for desktop and android.
Also, if the action works for one item (e.g. Gillman Engineer), then it works for all items.

If it doesn't work then the mod versions are different or the campaign/research progress is different.

Edit: you're right, not yet sure why
« Last Edit: April 08, 2025, 09:48:22 pm by Meridian »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9511
    • View Profile
Found the issue.

The touch buttons are actually working, but the R-click and M-click itself is not working... it was incorrectly merged into the Android branch already 9 years ago.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9511
    • View Profile
Fixed here: https://github.com/MeridianOXC/OpenXcom/commit/7ece70237c76e5aa5d125c042995d49ef7dd4529

I won't rebuild oxce 8.2 anymore, it will make its way into oxce 8.3.

Offline rkagerer

  • Captain
  • ***
  • Posts: 75
    • View Profile
Understood, thanks!