Announcement

Collapse
No announcement yet.

reading input when using a scaleform window

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    reading input when using a scaleform window

    Im not sure if this is scaleform or normal uscript here.

    what i have is a dialogbox made in scaleform showing up and i want a function i can read the keypress from.


    its my dialog for binding a key to a function so im saying

    "Please press the key you want to use for <bind friendly name>"

    and i just want to read in uscript the key that was pressed.

    Does anyone know how to do this correctly? i have hunted about and looked though google but cant find anything on this.

    #2
    well if you just want ro detect it use a keybinding in uscript. otherwise you can detect it in actionscript ad send it across.

    Comment


      #3
      Originally posted by rjmyth View Post
      well if you just want ro detect it use a keybinding in uscript. otherwise you can detect it in actionscript ad send it across.
      how.......

      Comment


        #4
        UnrealScript:

        Search your entire udk directory for a known binded console command, lets just say... Fire, Jump, Use, MoveForward, NextWeapon, just to name a few. Look at the files that come up and see how they relate to eachother.

        Flash:

        http://tinyurl.com/29wl3bf

        Comment


          #5
          Ok, i think its important to say this, i am trying to use input in a GFxMovie object.

          This object "takes" control of the keys when you set bCaptureInput=true.

          The traditional methods (of which i have used plenty of times) do not seem to work when the movie is up because it intercepts the keypresses and swallows them up.

          So the answer isnt to just look at how epic handle keybinds, because i have to either stop the movie swallowing them up in the first place or get the keypresses from the flash movie back to uscript.

          Id be perfectly happy to know where to start and figure this out for myself, but its undocumented with the exception of a mention in a video about intercepting keybinds using kismet, an exerpt of the handling keybinds internal documentation and thats about it.

          Its quite a simple question that has no answer that anyone knows.

          i just want to read in uscript the key that was pressed, how do i do this when i have a flash movie open thats bCaptureInput=true.

          Comment


            #6
            You might have a look at FilterButtonInput() in the GFxMoviePlayer. It may be able to do what you want.


            For more info, check the Input section here:

            http://udn.epicgames.com/Three/Scale...er%20Functions

            Comment


              #7
              If you have capture input set to true, also be sure to tell the class which key presses to intercept, using:

              Code:
                  AddCaptureKey('Gamepad_LeftStick_Left');
                  AddCaptureKey('XboxTypeS_A');
                  AddCaptureKey('XboxTypeS_Start');
                  AddCaptureKey('Enter');
                  AddCaptureKey('B');
                  AddCaptureKey('Spacebar');
                  AddCaptureKey('1');
                  AddCaptureKey('Up');
                  AddCaptureKey('Down');
                  AddCaptureKey('Left');
                  AddCaptureKey('Right');
                  AddCaptureKey('Enter');
              etc...

              Now if you want to know what was pressed specifically, you can set up a key listener in ActionScript that finds out. Then pass back to UnrealScript the information.

              Comment


                #8
                thanks matt, been working on the key listener, but not getting too far with that.

                plugging away

                every time i tried to pass back from Handleinput navEquivalent was always undefined, which i could have used to read the key pressed ((

                in fact navEquivalent is always undefined in the Scaleform player too - must need to do something else i guess...

                Comment


                  #9
                  ok if anyone can help me from loosing more hair

                  this is my code.

                  firstly i am using the unreals view and push/pop method for dialogs and menus.

                  I have created my class as follows
                  Code:
                  import flash.external.ExternalInterface;
                  import gfx.events.EventDispatcher;
                  import gfx.ui.InputDetails;
                  import gfx.ui.NavigationCode;
                  
                  class com.scaleform.TA.view.BindKeyDialog extends com.scaleform.udk.dialogs.InfoDialog
                  {
                  	
                  	public function BindKeyDialog() 
                  	{
                          super();   
                  	}
                  
                  
                      // Custom handleInput to handle standard input + unique cases.
                      function handleInput(details:InputDetails, pathToFocus:Array):Boolean 
                  	{          
                  		trace(details.code + " | " + details.navEquivalent + " | " + details.value + "\n");
                          
                          // Maps Escape-KeyUp to _global.OnEscapeKeyPress(), a function object defined in UnrealScript
                          // and set by each view which calls some method. Generally this pops a view from the view stack.
                          if (details.navEquivalent == NavigationCode.ESCAPE && details.value == "keyUp") {            
                              _global.OnEscapeKeyPress();
                              return true;
                          }
                  		        		
                  		ExternalInterface.call("OnhandleInput", details);
                          return false; 
                      }   
                  }
                  the only thing of real value here is the externalinterface call thats passing details back into uscript.

                  first problem here is that in trace details.navEquivalent is undefined (i dont know why if anyone else knows why id love the answer!)

                  so i thought it might be something that uscript needs to set.. maybe navEquivilant was only used when running though uscript (as some code only works this way)

                  so i plugged it all in

                  Code:
                  function OnhandleInput(GFxObject myInputObject)
                  {
                  	`Log("Value " $myInputObject.GetString("value"));
                  	`Log("navEquivalent " $myInputObject.GetString("navEquivalent"));
                  	`Log("code " $myInputObject.GetString("code"));
                  }
                  which is basically the trace call within uscript and navEquivalent is again undefined.


                  I was simply going to read navEquivalent (hoping it was a key) and use that to bind the key in uscript to the command i have ready.

                  Am i doing this the wrong way? is their a better way (examples very welcome) to do this??


                  im going to move onto some other code for the day or i wont get anything done

                  Comment


                    #10
                    Are you trying to achieve this?

                    http://www.youtube.com/user/stuartcr.../0/RVus86xu6Rg

                    If you are trying to achieve what I did there then I think you need to be capturing in the UDK and passing the info to scaleform, not the other way around.

                    Thanks
                    --
                    Stuart

                    Comment


                      #11
                      Looks exactly what im trying to do!

                      i got everything working as in your vid except the keypress part.

                      Do you have source code i can read on how you did that???

                      Comment


                        #12
                        GeekyPayback... that is something that I think would be a huge help to others on here. I certainly would be appreciative if you shared your code as well.

                        Honestly, for Epic/Scaleform, I think it would be great if lessons on how to setup some of the more generic PC centric options settings were available. They are not done in UDK, but are something every project made on UDK would benefit from.

                        Comment


                          #13
                          What would be more useful? A beginning to end of how I hooked it into all of the unreal stuff (finding defined keys and thier names automatically) or just the bit about how to capture a key and pass it through?

                          The full guide is rather complex, the capturing a key bit is pretty quick.

                          Comment


                            #14
                            i was planning on doing a few tutes on this subject, specifically the keybind menu, but im fast running out of time.

                            While it may appear quite straight forward whats been done, id still love the source to check if im doing it the "right" way.

                            Comment


                              #15
                              id just like to know how you got the capture key passed though

                              Comment

                              Working...
                              X