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"

[Slate Bug] SWidget::SetCursor(EMouseCursor::) doesnt do anything in a runtime game instance

Dear Friends at Epic,

Context

In-game instance, run from commandline, editor is not loaded

Goal

I am trying to hide the mouse cursor for an SWidget after it receives keyboard input focus.

Issue

I am unable to change it at all.

For testing I am using TextBeam

I am even trying to change the cursor for the gameviewport just as a test

There are only 2 swidgets in my test, game viewport and the widget I am trying to give the input to.

The keyboard input is going to the same widget I am setting cursor for

Any ideas how I can change mouse cursor for SWidget in game instance?

Code

 void SVictoryInputText::SetSlateUIMode(bool EnterSlateUI)
 {
     if(EnterSlateUI)
     {
         if (JoyInputText.IsValid())
         {
             FWidgetPath WidgetToFocusPath;
             
             bool bFoundPath = FSlateApplication::Get().FindPathToWidget(FSlateApplication::Get().GetInteractiveTopLevelWindows(), JoyInputText.ToSharedRef(), WidgetToFocusPath);
             if (bFoundPath && WidgetToFocusPath.IsValid())
             {
                 FSlateApplication::Get().SetKeyboardFocus(WidgetToFocusPath, EKeyboardFocusCause::SetDirectly);
                 
                 //No Mouse Cursor
                 SetCursor(EMouseCursor::TextEditBeam);
                 FSlateApplication::Get().GetGameViewport()->SetCursor(EMouseCursor::TextEditBeam);

Thanks!

Thanks!

Rama

Product Version: Not Selected
Tags:
more ▼

asked Jun 27 '14 at 12:02 PM in C++ Programming

avatar image

Rama
10.5k 444 343 1081

avatar image Rama Jun 27 '14 at 03:47 PM

Update

I tried using the CursorQuery setup that is used by SEditableText

It also will not ever change the mouse cursor, either to None or to TextBeam, during a commandline Editor-closed instance.

 FCursorReply SVictoryInputText::OnCursorQuery( const FGeometry& MyGeometry, const FPointerEvent& CursorEvent ) const
 {
     return FCursorReply::Cursor( EMouseCursor::TextEditBeam );
 }
(comments are locked)
10|2000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
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