|
| 02 Nov 2015 01:36 PM |
Yo guys, i'm currently working with gamepad compatibility, so i started to use UIS (UserInputService), it's works correctly, the only problem is that it activates even when chatting, which i don't want.
I use a keep key pressed to do it system, so i use InputBegan and InputEnded. |
|
|
| Report Abuse |
|
|
instawin
|
  |
| Joined: 04 Jun 2013 |
| Total Posts: 8777 |
|
|
| 02 Nov 2015 01:37 PM |
UIS.InputBegan:connect(function(input, gpe) if not gpe and input.KeyCode == Enum.KeyCode.Blah then print'blah' end end) |
|
|
| Report Abuse |
|
|
Locard
|
  |
| Joined: 13 Apr 2014 |
| Total Posts: 3516 |
|
|
| 02 Nov 2015 01:38 PM |
| The second argument that UIS gives is called GameProcessEvent, meaning it's an input generated from ROBLOX's core interface (accessing the menu for instance). You can check if this is false and it'll make sure that the rest of your code works only when not using a ROBLOX core gui. |
|
|
| Report Abuse |
|
|
| |
|
|
| 02 Nov 2015 01:40 PM |
| InputBegan returns a second argument, GameProccessedEvent. GPE will be true if the key input is being handled externally (by something like a TextBox for the chat), or false if it is not being handled externally. |
|
|
| Report Abuse |
|
|