chromiumboy Posted April 14, 2014 Share Posted April 14, 2014 (edited) Hey everyone, I was wondering if there is a way of determining whether an input from a player originated from the keyboard or from a gamepad? Edited April 14, 2014 by chromiumboy Link to comment https://forums.kleientertainment.com/forums/topic/34847-determining-the-source-of-an-input/ Share on other sites More sharing options...
JackSlender Posted April 14, 2014 Share Posted April 14, 2014 I would suggest looking in this file:C:\Program Files (x86)\Steam\steamapps\common\dont_starve\data\scripts\input.luaThat file contains the functions for all of the player's actions. It also includes the method GetInputDevices() which I do believe is exactly what you're looking for. Link to comment https://forums.kleientertainment.com/forums/topic/34847-determining-the-source-of-an-input/#findComment-453225 Share on other sites More sharing options...
chromiumboy Posted April 14, 2014 Author Share Posted April 14, 2014 Thanks, but GetInputDevices() simply lists the devices attached to the machine. I was looking for a potential way to link a button press to an input device. For example, the variable CONTROL_MOVE_UP seems to be assigned to two different buttons, one from the keyboard and one from the gamepad, is there a way to determine which input device activated the control handle? Link to comment https://forums.kleientertainment.com/forums/topic/34847-determining-the-source-of-an-input/#findComment-453236 Share on other sites More sharing options...
JackSlender Posted April 14, 2014 Share Posted April 14, 2014 You might want to try looking at the functions around that one. I haven't tested them myself, but things like Input:ControllerAttached(), Input:GetControllerID(), and TheInputProxy:GetInputDeviceType() sound promising. Link to comment https://forums.kleientertainment.com/forums/topic/34847-determining-the-source-of-an-input/#findComment-453245 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now