Android back key not working? v3.2.x and 3.3.1

I cannot let it work in any ways.
I did also try to put some logs on the android class, c++ class and ts files.
The flow goes straight and nicely since this._eventTarget.emit(eventType, inputEvent); in keyboard.ts but i never received the event on my ts files.
I use this code:

systemEvent.on(SystemEvent.EventType.KEY_UP,this.keyUpTest,this);

---
keyUpTest(event:EventKeyboard )
{
}

But it does not work.

I can engineering to have a look.

You can try overriding the dispatchKeyEvent method in the AppActivity.

Back key it’s working on web preview.
But it does not work on android apk.

Mmm i don’t think this will do what i am asking.
I am trying to send the back key event from android to my game in javascript.
So, as for example, if you press the back key during gameplay an ingame menu will open.

That should be already handled by cocos engine by actually did not work for me since 3.1.x
It did work on 3.0.x (even if there were this error )

Can you provide a simple demo?

Sorry for the late answer…
This is the little project:
AndroidBackKeyTester.zip (1.2 MB)

And this is the compiled (non working) apk:
https://drive.google.com/file/d/1hn62jhEerNN6_6Lu1MBhKwBIn1Adwv_l/view?usp=sharing

Sorry, I misunderstood you before, this issue is already being dealt with.
If it’s urgent, you can modify this file.
File path:\3.3.2\resources\resources\3d\engine\pal\input\native\keyboard.ts

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.