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

Implement Native Input support for Linux #3180

Closed
spham-amzn opened this issue Aug 11, 2021 · 7 comments
Closed

Implement Native Input support for Linux #3180

spham-amzn opened this issue Aug 11, 2021 · 7 comments
Assignees
Labels
platform/linux Issues affecting content related to Linux as a host or target platform. sig/platform Categorizes an issue or PR as relevant to SIG Platform. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@spham-amzn
Copy link
Contributor

No description provided.

@spham-amzn
Copy link
Contributor Author

spham-amzn commented Aug 11, 2021

Requirements

The Native Input abstraction layer in O3DE (Code/Framework/AzFramework/Input) allows for creating platform specific implementations on how input is handled for keyboards, mice, touch pad, etc. For Linux, the focus will specifically be on the following types of input:

  • Keyboard
  • Mouse

@RoddieKieley
Copy link
Contributor

I can help here, once I can build and run a little better in my native distro Fedora. I've done input a few times, with the latest open a few years back for Oryol web gamepad support floooh/oryol#242.

@kinglawr kinglawr transferred this issue from o3de/sig-platform Aug 17, 2021
@kinglawr kinglawr added the platform/linux Issues affecting content related to Linux as a host or target platform. label Aug 17, 2021
@kinglawr kinglawr assigned kinglawr and burelc-amzn and unassigned kinglawr Aug 24, 2021
@spham-amzn spham-amzn mentioned this issue Oct 12, 2021
@RoddieKieley
Copy link
Contributor

While the addition of the mouse and keyboard input on Linux via xcb was welcome, the gamepad/joystick support is as of yet not available. In reviewing previous discussions around this issue both sdl and glfw were discussed, and with sdl being removed recently and the glfw a seemingly simpler to grok and perhaps extract while being fairly mature.

In an effort to not re-invent the wheel, I've started with an approach of creating a gem to first use glfw directly to get gamepad/joystick input on Linux with a plan to then hollow that out to just the gamepad/joystick functionality. As well glfw may lend itself to helping with #745 for wayland support. Timeline unknown however, and atm investigating an issue where the mouse cursor does not reappear when I swtich away from the windowed o3de app which is a pita.

@RoddieKieley
Copy link
Contributor

For the moment when in debugging mode I simply ensure that ShowCursor always shows the cursor as per this commit on the 'HiddenCursorInDebugFix' branch in my copy of the repo at commit 758e4e6e8939e771559fc054f4b7762d4c4a4928. The behaviour was such that the cursor was hidden globally for the X window system, yet unconstrained so that I could interact with the debugger but not ascertain the cursor position until an element was lit by hovering or I clicked.

This likely should be more nuanced so that when the o3de app gives up the window focus it re-shows the cursor, but potentially still hides it when self focused and running. However this change unblocks me for the moment for the task at hand.

@RoddieKieley
Copy link
Contributor

Started to scaffold this in in o3de via my issue3180 branch while also subsequently refactoring glfw to separate the joystick/gamepad processing via an o3de_issue3180 branch in that project.

@RoddieKieley
Copy link
Contributor

A little long between being able to focus on this and it may be so again, however with the latest commit 466ab4c4397501ea951c40e9048f73741060dcd2 input is being polled and received per tick via the integrated glfw based gamepad code.

Pretty rough still but next steps will be seeing about processing the incoming input data into input channels for distribution via the event bus.

@spham-amzn spham-amzn added sig/platform Categorizes an issue or PR as relevant to SIG Platform. triage/accepted Indicates an issue or PR is ready to be actively worked on. labels Feb 28, 2022
@spham-amzn
Copy link
Contributor Author

This issue is closed from 46d1b19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform/linux Issues affecting content related to Linux as a host or target platform. sig/platform Categorizes an issue or PR as relevant to SIG Platform. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

4 participants