[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-openjfx-dev
Subject:    Re: Feature Idea: Mouse Input Grab in Window
From:       Kevin Rushforth <kevin.rushforth () oracle ! com>
Date:       2020-12-17 19:46:24
Message-ID: 044bc55e-0e26-868d-5cad-623eae2f8194 () oracle ! com
[Download RAW message or body]

I replied to a reply that snipped too much of this (I was thinking more 
of the full-screen fully immersive use case).

If all you are looking for is some way to prevent the cursor from 
leaving a Window, there might be a way to do it, but the implications of 
this would need to be carefully thought through. And there would need to 
be a way (at least by default) to exit out of this mode like there is 
for full-screen. I'm still unsure about the "mouse doesn't move" part of 
this.

-- Kevin



On 12/17/2020 9:17 AM, Almas Baimagambetov wrote:
> Hi,
>
> Johan Vos and I had a quick chat about this feature and he suggested it
> might be a good idea to start a discussion.
>
> *Use case:* 3D games or 3D modelling tools, where the application "grabs"
> (gets exclusive control of) the mouse and moving the mouse doesn't move the
> cursor.
>
> *Feature:* Allow to confine the mouse to a window. The cursor is centered
> on the window and does not move/leave the window, whilst all mouse move
> events are reported normally. Since this is already provided by native code
> (e.g. Windows API), an implementation of this would probably be a wrapper,
> similar to the wrapper that the SDL library provides:
> https://wiki.libsdl.org/SDL_SetWindowGrab
>
> *Possible high-level API:*
>
> Window window = ...
> window.setMouseGrabbed(true);
>
> *Alternatives*:
>
> I've tried working around this by using Robot API, but it isn't quite the
> same.
>
> Kind regards, Almas

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic