AGK for Pascal
ContentsIndexHome
PreviousUpNext
TAgkRawJoystick.HasJoystick Method

Returns True if a joystick exists at the given index.

Syntax
Pascal
class function HasJoystick(const Index: Integer): Boolean; static;
Parameters 
Description 
const Index: Integer 
The ID of the joystick to check (1-4). 

Physical joysticks are detected at startup and placed in IDs 1-4 incrementally. You should call CompleteDetection at some point before this command to make sure that all present joysticks have been discovered. After the initial detection process plugging in additional joysticks will not be detected. Unplugging a joystick will not delete its index and this command will still return True, but all the joystick's values will return 0. If a disconnected joystick is reattached the AGK will attempt to reconnect to it, but this cannot be guaranteed. 

See also Exists which will return True if there are any raw joysticks attached.

Copyright (c) 2012. All rights reserved.