How can I use New Input System with UI Button Key Trigger?
How can I use New Input System with UI Button Key Trigger?
I want to use custom action command(New Input System) during a Conversation, but If I assign my action to UI Key Trigger, the command is recognized as a double click.
Re: How can I use New Input System with UI Button Key Trigger?
You can assign an Input System's input action to a UI Button Key Trigger component's Button Name, but make sure it's not the same input as the EventSystem's InputSystemUIInputManager > Submit input. Otherwise it will double click.
Re: How can I use New Input System with UI Button Key Trigger?
I did it, but the problem hasn't been solved yet.
Did I do something wrong?
Did I do something wrong?
- Attachments
-
- input device manager
- inputDeviceManager.PNG (49.14 KiB) Viewed 670 times
-
- continue button
- continueButton.PNG (31.51 KiB) Viewed 670 times
-
- new input system
- event_02.PNG (24.36 KiB) Viewed 670 times
-
- event system
- event_01.PNG (48.3 KiB) Viewed 670 times
Re: How can I use New Input System with UI Button Key Trigger?
What if you do the following instead:
If you want the left mouse button to also continue regardless of where the player clicks, make the continue button transparent and cover the whole screen. If you want a separate visible continue indicator, you can add that, too, but as an Image instead of a Button. To set up the whole-screen continue button, please see option #2 in this post.
If you don't want to do this, and if you want to proceed with your current approach, may I ask the reason? This will help me provide a more comprehensive answer. Also, if you want to proceed with your current approach, please show the script in which you're registering the Continue action with the Input Device Manager.
- On the Dialogue Manager GameObject, tick the Input Device Manager's Always Auto Focus checkbox.
- On the continue button, remove the UI Button Key Trigger component.
- On the EventSystem GameObject, set the Input System UI Input Module's Submit input back to UI/Submit.
If you want the left mouse button to also continue regardless of where the player clicks, make the continue button transparent and cover the whole screen. If you want a separate visible continue indicator, you can add that, too, but as an Image instead of a Button. To set up the whole-screen continue button, please see option #2 in this post.
If you don't want to do this, and if you want to proceed with your current approach, may I ask the reason? This will help me provide a more comprehensive answer. Also, if you want to proceed with your current approach, please show the script in which you're registering the Continue action with the Input Device Manager.
Re: How can I use New Input System with UI Button Key Trigger?
When I display a Menu or a BackLog on the screen during a Conversation, I use this code below to prevent Continue button's On Fast Forward.
code from :: https://pixelcrushers.com/phpbb/viewtop ... f=3&t=4345
At this time, I can only prevent On Fast Forward using the UI Button Key Trigger.(when I use only Input Device Manager, It didn't work.)
Also, I'm creating an option for players to key rebinding, through the New Input System.
These are the reasons why I want to use the new input system.
Code: Select all
PixelCrushers.UIPanel.monitorSelection = false; // Don't allow dialogue UI to steal back input focus.
PixelCrushers.UIButtonKeyTrigger.monitorInput = false; // Disable hotkeys.
PixelCrushers.DialogueSystem.DialogueManager.Pause(); // Stop DS timers (e.g., sequencer commands).
At this time, I can only prevent On Fast Forward using the UI Button Key Trigger.(when I use only Input Device Manager, It didn't work.)
Also, I'm creating an option for players to key rebinding, through the New Input System.
These are the reasons why I want to use the new input system.
- Attachments
-
- I'm using the basic code for registering Continue action
- PlayercontrolRegistration.png (70.4 KiB) Viewed 652 times
Re: How can I use New Input System with UI Button Key Trigger?
Hi,
You can make a subclass of UIButtonKeyTrigger and override IsBeingClickedBySubmit() to check if the Input System is registering a click on the button. Or replace it entirely with your own script if you prefer, and configure that script to call the continue button's StandardUIContinueButtonFastForward.OnFastForward().
You can make a subclass of UIButtonKeyTrigger and override IsBeingClickedBySubmit() to check if the Input System is registering a click on the button. Or replace it entirely with your own script if you prefer, and configure that script to call the continue button's StandardUIContinueButtonFastForward.OnFastForward().
Re: How can I use New Input System with UI Button Key Trigger?
Ohhh... Sorry, I didn't know that the New Input System was also available in the Input Device Manager.
I solved my problem using your second answer.
(I put my custom action in the Submit button, and it works properly.)
I solved my problem using your second answer.
(I put my custom action in the Submit button, and it works properly.)
- Attachments
-
- Submit.png (44.7 KiB) Viewed 646 times
Re: How can I use New Input System with UI Button Key Trigger?
Great! I'm glad you got it working.