The future is now. Read Hardware inputs from devices plugged into a computer, cross-platform!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jinput2.10/docs/net/java/games/input/Controller.html

296 lines
19 KiB

<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) on Wed Jun 22 19:30:51 UTC 2022 -->
<title>Controller (jinput API)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="dc.created" content="2022-06-22">
<meta name="description" content="declaration: package: net.java.games.input, interface: Controller">
<meta name="generator" content="javadoc/ClassWriterImpl">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../script-dir/jquery-ui.min.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../jquery-ui.overrides.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
<script type="text/javascript" src="../../../../script-dir/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="../../../../script-dir/jquery-ui.min.js"></script>
</head>
<body class="class-declaration-page">
<script type="text/javascript">var evenRowColor = "even-row-color";
var oddRowColor = "odd-row-color";
var tableTab = "table-tab";
var activeTableTab = "active-table-tab";
var pathtoroot = "../../../../";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="flex-box">
<header role="banner" class="flex-header">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="top-nav" id="navbar-top">
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
<li><a href="../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="nav-bar-cell1-rev">Class</li>
<li><a href="class-use/Controller.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../help-doc.html#class">Help</a></li>
</ul>
</div>
<div class="sub-nav">
<div>
<ul class="sub-nav-list">
<li>Summary:&nbsp;</li>
<li><a href="#nested-class-summary">Nested</a>&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method-summary">Method</a></li>
</ul>
<ul class="sub-nav-list">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method-detail">Method</a></li>
</ul>
</div>
<div class="nav-list-search"><label for="search-input">SEARCH:</label>
<input type="text" id="search-input" value="search" disabled="disabled">
<input type="reset" id="reset-button" value="reset" disabled="disabled">
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip-navbar-top"></span></nav>
</header>
<div class="flex-content">
<main role="main">
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="sub-title"><span class="package-label-in-type">Package</span>&nbsp;<a href="package-summary.html">net.java.games.input</a></div>
<h1 title="Interface Controller" class="title">Interface Controller</h1>
</div>
<section class="class-description" id="class-description">
<dl class="notes">
<dt>All Known Implementing Classes:</dt>
<dd><code><a href="AbstractController.html" title="class in net.java.games.input">AbstractController</a></code>, <code><a href="Keyboard.html" title="class in net.java.games.input">Keyboard</a></code>, <code><a href="LinuxCombinedController.html" title="class in net.java.games.input">LinuxCombinedController</a></code>, <code><a href="Mouse.html" title="class in net.java.games.input">Mouse</a></code>, <code><a href="WinTabDevice.html" title="class in net.java.games.input">WinTabDevice</a></code></dd>
</dl>
<hr>
<div class="type-signature"><span class="modifiers">public interface </span><span class="element-name type-name-label">Controller</span></div>
<div class="block">A Controller represents a physical device, such as a keyboard, mouse,
or joystick, or a logical grouping of related controls, such as a button
pad or mouse ball. A controller can be composed of multiple controllers.
For example, the ball of a mouse and its buttons are two separate
controllers.</div>
</section>
<section class="summary">
<ul class="summary-list">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<li>
<section class="nested-class-summary" id="nested-class-summary">
<h2>Nested Class Summary</h2>
<div class="caption"><span>Nested Classes</span></div>
<div class="summary-table three-column-summary">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Interface</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color"><code>static final class&nbsp;</code></div>
<div class="col-second even-row-color"><code><a href="Controller.PortType.html" class="type-name-link" title="class in net.java.games.input">Controller.PortType</a></code></div>
<div class="col-last even-row-color">
<div class="block">Common controller port types.</div>
</div>
<div class="col-first odd-row-color"><code>static class&nbsp;</code></div>
<div class="col-second odd-row-color"><code><a href="Controller.Type.html" class="type-name-link" title="class in net.java.games.input">Controller.Type</a></code></div>
<div class="col-last odd-row-color">
<div class="block">Types of controller objects.</div>
</div>
</div>
</section>
</li>
<!-- ========== METHOD SUMMARY =========== -->
<li>
<section class="method-summary" id="method-summary">
<h2>Method Summary</h2>
<div id="method-summary-table">
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab3" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab3', 3)" class="table-tab">Abstract Methods</button></div>
<div id="method-summary-table.tabpanel" role="tabpanel">
<div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Method</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="Component.html" title="interface in net.java.games.input">Component</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getComponent(net.java.games.input.Component.Identifier)" class="member-name-link">getComponent</a><wbr>(<a href="Component.Identifier.html" title="class in net.java.games.input">Component.Identifier</a>&nbsp;id)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Returns a single axis based on its type, or null
if no axis with the specified type could be found.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="Component.html" title="interface in net.java.games.input">Component</a>[]</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getComponents()" class="member-name-link">getComponents</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Returns the components on this controller, in order of assignment priority.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="AbstractController.html" title="class in net.java.games.input">AbstractController</a>[]</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getControllers()" class="member-name-link">getControllers</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Returns the controllers connected to make up this controller, or
an empty array if this controller contains no child controllers.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="EventQueue.html" title="class in net.java.games.input">EventQueue</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getEventQueue()" class="member-name-link">getEventQueue</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Get the device event queue</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getName()" class="member-name-link">getName</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Returns a human-readable name for this Controller.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>int</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getPortNumber()" class="member-name-link">getPortNumber</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Returns the zero-based port number for this Controller.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="Controller.PortType.html" title="class in net.java.games.input">Controller.PortType</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getPortType()" class="member-name-link">getPortType</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Returns the port type for this Controller.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="Rumbler.html" title="interface in net.java.games.input">Rumbler</a>[]</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getRumblers()" class="member-name-link">getRumblers</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Returns the rumblers for sending feedback to this controller, or an
empty array if there are no rumblers on this controller.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="Controller.Type.html" title="class in net.java.games.input">Controller.Type</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getType()" class="member-name-link">getType</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Returns the type of the Controller.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>boolean</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#poll()" class="member-name-link">poll</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Polls axes for data.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#setEventQueueSize(int)" class="member-name-link">setEventQueueSize</a><wbr>(int&nbsp;size)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
<div class="block">Initialized the controller event queue to a new size.</div>
</div>
</div>
</div>
</div>
</section>
</li>
</ul>
</section>
<section class="details">
<ul class="details-list">
<!-- ============ METHOD DETAIL ========== -->
<li>
<section class="method-details" id="method-detail">
<h2>Method Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="getControllers()">
<h3>getControllers</h3>
<div class="member-signature"><span class="return-type"><a href="AbstractController.html" title="class in net.java.games.input">AbstractController</a>[]</span>&nbsp;<span class="element-name">getControllers</span>()</div>
<div class="block">Returns the controllers connected to make up this controller, or
an empty array if this controller contains no child controllers.
The objects in the array are returned in order of assignment priority
(primary stick, secondary buttons, etc.).</div>
</section>
</li>
<li>
<section class="detail" id="getType()">
<h3>getType</h3>
<div class="member-signature"><span class="return-type"><a href="Controller.Type.html" title="class in net.java.games.input">Controller.Type</a></span>&nbsp;<span class="element-name">getType</span>()</div>
<div class="block">Returns the type of the Controller.</div>
</section>
</li>
<li>
<section class="detail" id="getComponents()">
<h3>getComponents</h3>
<div class="member-signature"><span class="return-type"><a href="Component.html" title="interface in net.java.games.input">Component</a>[]</span>&nbsp;<span class="element-name">getComponents</span>()</div>
<div class="block">Returns the components on this controller, in order of assignment priority.
For example, the button controller on a mouse returns an array containing
the primary or leftmost mouse button, followed by the secondary or
rightmost mouse button (if present), followed by the middle mouse button
(if present).
The array returned is an empty array if this controller contains no components
(such as a logical grouping of child controllers).</div>
</section>
</li>
<li>
<section class="detail" id="getComponent(net.java.games.input.Component.Identifier)">
<h3>getComponent</h3>
<div class="member-signature"><span class="return-type"><a href="Component.html" title="interface in net.java.games.input">Component</a></span>&nbsp;<span class="element-name">getComponent</span><wbr><span class="parameters">(<a href="Component.Identifier.html" title="class in net.java.games.input">Component.Identifier</a>&nbsp;id)</span></div>
<div class="block">Returns a single axis based on its type, or null
if no axis with the specified type could be found.</div>
</section>
</li>
<li>
<section class="detail" id="getRumblers()">
<h3>getRumblers</h3>
<div class="member-signature"><span class="return-type"><a href="Rumbler.html" title="interface in net.java.games.input">Rumbler</a>[]</span>&nbsp;<span class="element-name">getRumblers</span>()</div>
<div class="block">Returns the rumblers for sending feedback to this controller, or an
empty array if there are no rumblers on this controller.</div>
</section>
</li>
<li>
<section class="detail" id="poll()">
<h3>poll</h3>
<div class="member-signature"><span class="return-type">boolean</span>&nbsp;<span class="element-name">poll</span>()</div>
<div class="block">Polls axes for data. Returns false if the controller is no longer valid.
Polling reflects the current state of the device when polled.</div>
</section>
</li>
<li>
<section class="detail" id="setEventQueueSize(int)">
<h3>setEventQueueSize</h3>
<div class="member-signature"><span class="return-type">void</span>&nbsp;<span class="element-name">setEventQueueSize</span><wbr><span class="parameters">(int&nbsp;size)</span></div>
<div class="block">Initialized the controller event queue to a new size. Existing events
in the queue are lost.</div>
</section>
</li>
<li>
<section class="detail" id="getEventQueue()">
<h3>getEventQueue</h3>
<div class="member-signature"><span class="return-type"><a href="EventQueue.html" title="class in net.java.games.input">EventQueue</a></span>&nbsp;<span class="element-name">getEventQueue</span>()</div>
<div class="block">Get the device event queue</div>
</section>
</li>
<li>
<section class="detail" id="getPortType()">
<h3>getPortType</h3>
<div class="member-signature"><span class="return-type"><a href="Controller.PortType.html" title="class in net.java.games.input">Controller.PortType</a></span>&nbsp;<span class="element-name">getPortType</span>()</div>
<div class="block">Returns the port type for this Controller.</div>
</section>
</li>
<li>
<section class="detail" id="getPortNumber()">
<h3>getPortNumber</h3>
<div class="member-signature"><span class="return-type">int</span>&nbsp;<span class="element-name">getPortNumber</span>()</div>
<div class="block">Returns the zero-based port number for this Controller.</div>
</section>
</li>
<li>
<section class="detail" id="getName()">
<h3>getName</h3>
<div class="member-signature"><span class="return-type"><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">getName</span>()</div>
<div class="block">Returns a human-readable name for this Controller.</div>
</section>
</li>
</ul>
</section>
</li>
</ul>
</section>
<!-- ========= END OF CLASS DATA ========= -->
</main>
</div>
</div>
</body>
</html>