Game controller list

From Sim Innovations Wiki
Jump to navigation Jump to search

Description

game_controller_id = game_controller_list()

game_controller_list is used to list all available joysticks on the system.


Info Game controllers can only be used on Windows and Linux platforms.

Return value

Argument Type Description
game_controller_list String[] An array with all the game controllers. You can use an item in this list for the game_controller_add function.

Arguments

This function has no arguments.

Example

function callback(type, index, value)
    print("type = " .. type .. ", index = " .. index .. ", value = " .. tostring(value))
end

list = game_controller_list()

for k, v in pairs(list) do
    game_controller_add(v, callback)
end