Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Game Development
  4. Mouse Control on Wayland: Calculating Delta Without Centering
Forum Updated to NodeBB v4.3 + New Features

Mouse Control on Wayland: Calculating Delta Without Centering

Scheduled Pinned Locked Moved Unsolved Game Development
2 Posts 1 Posters 110 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • EndrII 0E Offline
    EndrII 0E Offline
    EndrII 0
    wrote last edited by
    #1

    Hi, I'm having trouble implementing mouse-controlled camera movement in my game on Linux using the Wayland protocol.

    Wayland prevents setting the cursor position within the game, but this is necessary when the player moves the mouse to the screen edge, making it impossible to continue calculating the movement delta.

    To fix this, developers usually use the setPos function of QCursor to reset the mouse position to the screen center. However, this isn't possible on Wayland.

    [06-23 12:35:41.836 42381 Warning] Setting cursor position is not possible on wayland
    

    A temporary solution is to use the XCB plugin for X11, but X11 is very bad for games and FPS. Additionally, the XCB plugin freezes with vSync on Linux systems.

    So, the question is: does anyone have solutions for calculating mouse movement delta without centering the cursor?

    1 Reply Last reply
    0
    • EndrII 0E Offline
      EndrII 0E Offline
      EndrII 0
      wrote last edited by
      #2

      Probably exists way when i can handle low level signal for mouse - without cursor position, but with velocity vectors or directions vectors?

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved