Detect if mouse or joystick is used in script

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
fallingstarint
Posts: 22
Joined: Fri Oct 01, 2021 11:50 am

Detect if mouse or joystick is used in script

Post by fallingstarint »

Hello,

I have the component "Input Device Manager" on my Dialogue System, which is really useful but I also would like to integrate it in my Pause system via script.

Because I have a virtual cursor that I would like to disable and enable again along the pause state of my game and other conditions.

How would I check it in script?

Kind regards
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: Detect if mouse or joystick is used in script

Post by Tony Li »

Hi,

You can check InputDeviceManager.instance.IsUsingJoystick(), IsUsingMouse(), or IsUsingKeyboard().
fallingstarint
Posts: 22
Joined: Fri Oct 01, 2021 11:50 am

Re: Detect if mouse or joystick is used in script

Post by fallingstarint »

Thank you kind sir.
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: Detect if mouse or joystick is used in script

Post by Tony Li »

Glad to help!
Post Reply