streetpea / chiaki4deck

Fork of Chiaki (Open Source Playstation Remote Play) with Enhancements for Steam Deck and Documentation around how to use
https://streetpea.github.io/chiaki4deck/
GNU Affero General Public License v3.0
925 stars 58 forks source link

Inquiry on Native Keyboard Input Support in Chiaki4deck #324

Open PekkaPekka071 opened 2 months ago

PekkaPekka071 commented 2 months ago

Hello,

I hope this message finds you well. I wanted to take a moment to express my appreciation for the chiaki4deck project. It's an impressive fork that has significantly enhanced the PlayStation Remote Play experience for many users, myself included.

I'm reaching out to discuss a particular feature related to keyboard inputs. I've noticed that when connecting chiaki4deck to my PS5, the console recognizes it as a keyboard device. This is a promising aspect, as my goal is to have keyboard inputs handled similarly to the official PS Remote Play app, where the keyboard is not emulating a controller but is used directly.

Upon reviewing the chiaki4deck project, I observed that there are components related to keyboard input handling. Given this, I'm curious if there's a way to configure or modify chiaki4deck to remove the controller emulation entirely and use keyboard inputs natively.

Would it be possible to achieve this by recoding the input handling portion of the chiaki4deck codebase? Or is there an alternative method that you might recommend?

Any guidance or suggestions you could provide would be greatly appreciated. Thank you for your time and for the incredible work on chiaki4deck.

streetpea commented 2 months ago

Have you taken a look at the enable_keyboard flag in the connect_info of streamsession.cpp https://github.com/streetpea/chiaki4deck/blob/2333d1bd1e398c6fff19ed7b6672d97b94903734/gui/src/streamsession.cpp#L71 and the keyboard set text and other functions in ctrl? https://github.com/streetpea/chiaki4deck/blob/2333d1bd1e398c6fff19ed7b6672d97b94903734/lib/src/ctrl.c#L256 ... if you are trying to achieve entering text with a keyboard .. not exactly sure what you're trying to achieve

PekkaPekka071 commented 2 months ago

Thank you for your prompt response and for taking the time to consider my query. I apologize for any confusion caused by my initial message.

To clarify, my intention is not to enter text with a keyboard. Instead, I am looking to use chiaki4deck to play games with a keyboard and mouse setup. The game I frequently play encounters issues when recognizing controller and mouse inputs simultaneously, leading to input conflicts. My goal is to configure chiaki4deck in such a way that it allows me to use keyboard and mouse inputs without emulating a controller, thereby avoiding these conflicts.

I hope this explanation makes my objective clearer. If you have any suggestions on how I might achieve this, or if there's a possibility to include such functionality in future updates, I would be very grateful to hear your thoughts.

Thank you once again for your attention to this matter.

streetpea commented 2 months ago

Ah i see … how are you getting mouse support with Chiaki4deck I thought that wasn’t supported…

streetpea commented 2 months ago

Are you saying using keyboard and mouse works with the official remote play app from Sony? I thought mouse wasn’t supported.

PekkaPekka071 commented 2 months ago

Thank you for your response and for raising that point. Let me clarify: my mouse is directly connected to my PS5 via USB, and it's the keyboard functionality that I'm looking to implement through chiaki4deck wirelessly. Essentially, I'm aiming to use chiaki4deck as a wireless keyboard, similar to how an external keyboard would be recognized when connected to the PS5.

This setup works seamlessly with the official PS Remote Play, where the system recognizes the keyboard inputs directly. My hope is to replicate this functionality in chiaki4deck, allowing me to use my mouse (connected via USB to the PS5) and a 'virtual' keyboard through chiaki4deck simultaneously without any input conflicts.

I appreciate your time and assistance in exploring whether this is a feasible enhancement for chiaki4deck.

streetpea commented 2 months ago

I think I understand now. In that case you will want a setting for native keyboard support (you will want a separate option since most would want keyboard to emulate controller to support games without keyboard support) and you will need to reverse engineer whatever PlayStation is doing for native keyboard support

PekkaPekka071 commented 2 months ago

Yes, that's exactly the issue I've been trying to articulate, and I'm grateful for your understanding. I'm interested in learning more about how to specifically achieve this. Would it involve inspecting the PS Remote Play's keyboard input handling and then attempting to replicate that functionality within chiaki4deck?

I understand this might be a complex task, but any guidance or starting points you could provide would be immensely helpful. Thank you once again for your time and assistance.

streetpea commented 2 months ago

Yes, I would start by inspecting the packets and looking for what is sent when using the keyboard … you can inspect packets using wireshark on ports 9295 (tcp) and 9296 (udp) for the local connection … the stuff for 9295 is here https://github.com/streetpea/chiaki4deck/blob/main/lib/src/ctrl.c the stuff that is over 9296 is here https://github.com/streetpea/chiaki4deck/blob/main/lib/src/takion.c (the packets have a type that is set in the first byte of the message to differentiate them https://github.com/streetpea/chiaki4deck/blob/a5647fc9cf0b01027aa02328c0e17adf85f36c00/lib/src/takion.c#L56).

JohnShiozo commented 1 month ago

im also facing the same issues as @PekkaPekka071 looks like its a input conflict

JohnShiozo commented 1 month ago

im really looking forward if this issue could be solved