x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Disabling mouse cursor requires extra click to re-enable mouse X/Y

When I enable my mouse cursor, click around with it for a bit and then disable it through anything other than a mouse click, the mouse X/Y axis inputs do not function for anything else until a mouse click is made. Also if I hold down a mouse button while disabling the cursor, it works as it should.

How can I remove the need to click to re-enable X/Y axis inputs after the cursor has been disabled? The blueprint I'm using to disable/enable the mouse is below.

alt text

Product Version: Not Selected
Tags:
more ▼

asked Jul 14 '14 at 03:51 PM in Blueprint Scripting

avatar image

Bohrium
298 21 16 43

avatar image Devero Jul 19 '14 at 10:22 PM

I'm experiencing the same problem even in Standalone mode. For example:: 1) Hit "F" key to bring up Inventory, enable the mouse 2) Successfully click on panels and whatnots 3) Hit "F" key to close inventory, disable the mouse

However, the mouse look does not work until I hit a mouse button. I ideally I shouldn't have to do the extra mouse click to regain control of the mouse look.

to release the mouse control bShowMouseCursor = false; bEnableClickEvents = false; bEnableMouseOverEvents = false;

I've tried adding: FSlateApplication::Get().SetFocusToGameViewport();

Currently, i'm tracing down the states on why the mousebutton regains control in the code, but the hunt is slow. Any suggestions? I'm currently blocking out the following code area but I could be far off still :

FReply FSceneViewport::OnMouseButtonDown( const FGeometry& InGeometry, const FPointerEvent& InMouseEvent )

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

8 answers: sort voted first

Just saw this question while looking for the answer myself. Little late, but this is a way of how you could do it on the blueprint side:

alt text

setfocus.png (111.5 kB)
more ▼

answered Mar 14 '15 at 02:13 PM

avatar image

Truun
135 9 62 20

avatar image DG Gage Mar 14 '15 at 02:21 PM

Yep, ^ easiest way right there

avatar image RimmyD May 13 '15 at 09:56 PM

Sadly this does not actually work. Still requires a click afterward.

avatar image Burnrate Aug 03 '17 at 02:37 AM

Did you ever figure this out?

EDIT: Oh hmm nvm you need to call SetInputModeGameOnly on the player controller.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

There are two standard functions in the Blueprint: alt text

more ▼

answered Mar 14 '15 at 02:55 PM

avatar image

xangs
86 3 7 12

avatar image RimmyD May 13 '15 at 09:57 PM

This does not solve the problem that it requires a click after changing showMouseCursor

avatar image Ansigar Aug 12 '15 at 04:26 AM

Hey I figured it out here- http://youtu.be/RvDHS5KOn58

avatar image Limpieza May 19 '15 at 02:52 PM

I'm facing the same problem, and it does not solve my problem too.

avatar image AlphaSierra216 Aug 07 '17 at 05:46 AM

This did solve my problem.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Well, I was able to figure out the problem and the fix for the c++ side. Basically, the problem is with which slatewidget has focus and then to refocus back onto the clientviewport.

To release the mouse and regain "Mouse Look" for C++:

 //Release the mouse events and don't draw the mouse
         bShowMouseCursor = false;
         bEnableClickEvents = false;
         bEnableMouseOverEvents = false;
 
 // Since the viewport may not be the current focus, 
 // we need to re-focus whatever the current focus is,
 // in order to ensure it gets a chance to reapply any custom input settings
         auto CurrentFocus = FSlateApplication::Get().GetKeyboardFocusedWidget();
         FSlateApplication::Get().ClearKeyboardFocus(EKeyboardFocusCause::SetDirectly);
         FSlateApplication::Get().SetKeyboardFocus(CurrentFocus);


Maybe you can use this information to figure out the blueprint method equivalents. Hope it helps.

more ▼

answered Jul 20 '14 at 10:49 AM

avatar image

Devero
2.3k 114 62 234

avatar image Bohrium Jul 20 '14 at 12:37 PM

Ah alright, I'll see if I can do anything with blueprints, if not I'll just have to add the code in. Cheers.

avatar image Pseudocorpus Feb 12 '15 at 06:48 PM

I am getting an error: " use of undefined type 'FSlateApplication' "

EDIT: an #include "SlateBasics.h" fixed the problem... but nevertheless this approach doesn't work for me. Still no reanabling the mouse look.

EDIT2: Nevermind, it works now... I changed the bools after the FSlateApplication-Lines

avatar image Pseudocorpus Apr 01 '16 at 12:14 AM

This Problem re-appears in 4.11

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

None of these suggestions worked for me, but I found a way.

I noticed the Set Input Mode Target input didn't have "Target: Self" like nodes usually do, but instead just "Target", so I chucked a self ref on it and the problem was gone!, remove the self and it returns. Self ref Ignore the "In Widget to Focus" input, that isn't required, but I passed it through anyway. why not? :D

I didn't have any issues going back to game only input mode. but here's the bit that does that from the widget graph. alt text

more ▼

answered Aug 22 '15 at 03:02 PM

avatar image

KWS
125 5 8 15

avatar image Devero Aug 22 '15 at 03:53 PM

Good news =)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

I duduned figured it out!

http://youtu.be/RvDHS5KOn58

more ▼

answered Aug 12 '15 at 04:25 AM

avatar image

Ansigar
1 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Hey I figured it out here - http://youtu.be/RvDHS5KOn58

more ▼

answered Aug 12 '15 at 04:26 AM

avatar image

Ansigar
1 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question