Does naninovell script support keyboard input?

Posted: 25 Oct 2022 07:51
by booksuny

I'm sorry I have a lot of questions.

I want to put QTA mini game using keyboard input during game.

Looking at the manual, I'm asking you a question because it seems that there are only menus that are opened using the keyboard.

Is there a function to choose a choice using keyboard input in naninovell script?


Re: Does naninovell script support keyboard input?

Posted: 25 Oct 2022 09:42
by idaot

Naninovel supports basic keyboard navigation by default via the Legacy Input Manager (and the new Input System if using it instead). You can find the legacy bindings in the Input Manager under Project Settings. If you want to trigger buttons with an arbitrary key, consider setting up samplers for the buttons. An example of such can be found in the Inventory example project mentioned in the Input Processing guide: https://naninovel.com/guide/input-proce ... processing


Re: Does naninovell script support keyboard input?

Posted: 27 Oct 2022 08:47
by booksuny
idaot wrote: 25 Oct 2022 09:42

Naninovel supports basic keyboard navigation by default via the Legacy Input Manager (and the new Input System if using it instead). You can find the legacy bindings in the Input Manager under Project Settings. If you want to trigger buttons with an arbitrary key, consider setting up samplers for the buttons. An example of such can be found in the Inventory example project mentioned in the Input Processing guide: https://naninovel.com/guide/input-proce ... processing

Thank you for your answer, and I have additional questions.

Does naninovell provide the ability to add keyboard input to the @choice function?

Like classical RPGs, I want to select a choice with a numeric key, or I want to control the selection button action that sometimes appears with a WASD key.


Re: Does naninovell script support keyboard input?

Posted: 27 Oct 2022 09:21
by idaot

Choices are meant for simple story navigation so technically it's not ideal to go beyond that - but you are free to add custom scripts to the buttons, including ones for activating different input samplers and have them invoke select upon input activation.


Re: Does naninovell script support keyboard input?

Posted: 27 Oct 2022 10:52
by booksuny
idaot wrote: 27 Oct 2022 09:21

Choices are meant for simple story navigation so technically it's not ideal to go beyond that - but you are free to add custom scripts to the buttons, including ones for activating different input samplers and have them invoke select upon input activation.

Thank you for your reply.
I want to make sure that I understand well because I am not good at English.

  1. You cannot assign keyboard input to @choice.
  2. If you want to use keyboard input, you should make your own buttons and use them.

Did I get it right?


Re: Does naninovell script support keyboard input?

Posted: 27 Oct 2022 11:13
by idaot
  1. You can't do that via @choice, that's right.
  2. Yes, you can make a button for each of the keyboard input you want to activate. You should be able to make a custom script with a public/serialized string value in which you can specify the sampler you want to activate and change it with each variation.