Merge pull request #31 from dyorgio/master

Included GitHub Pages  support
This commit is contained in:
Endolf 2018-06-01 16:20:17 +01:00 committed by GitHub
commit f7742fbd95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 123 additions and 0 deletions

5
docs/_config.yml Normal file
View file

@ -0,0 +1,5 @@
title: JInput
description: Library for access to input devices.
show_downloads: true
google_analytics:
theme: jekyll-theme-cayman

View file

@ -0,0 +1,47 @@
<!DOCTYPE html>
<html lang="{{ site.lang | default: "en-US" }}">
<head>
<meta charset="UTF-8">
{% seo %}
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#157878">
<link rel="stylesheet" href="{{ '/assets/css/style.css?v=' | append: site.github.build_revision | relative_url }}">
</head>
<body>
<section class="page-header">
<h1 class="project-name">{{ site.title | default: site.github.repository_name }}</h1>
<h2 class="project-tagline">{{ site.description | default: site.github.project_tagline }}</h2>
{% if site.github.is_project_page %}
<a href="{{ site.github.repository_url }}" class="btn">View on GitHub</a>
{% endif %}
{% if site.show_downloads %}
<a href="{{ site.github.zip_url }}" class="btn">Download .zip</a>
<a href="{{ site.github.tar_url }}" class="btn">Download .tar.gz</a>
{% endif %}
</section>
<section class="main-content">
{{ content }}
<footer class="site-footer">
{% if site.github.is_project_page %}
<span class="site-footer-owner"><a href="{{ site.github.repository_url }}">{{ site.github.repository_name }}</a> is maintained by <a href="{{ site.github.owner_url }}">{{ site.github.owner_name }}</a>.</span>
{% endif %}
<span class="site-footer-credits">This page was generated by <a href="https://pages.github.com">GitHub Pages</a>.</span>
</footer>
</section>
{% if site.google_analytics %}
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', '{{ site.google_analytics }}', 'auto');
ga('send', 'pageview');
</script>
{% endif %}
</body>
</html>

71
docs/index.md Normal file
View file

@ -0,0 +1,71 @@
---
layout: default
---
[![Maven Central](https://img.shields.io/maven-central/v/net.java.jinput/jinput.svg)](https://maven-badges.herokuapp.com/maven-central/net.java.jinput/jinput)
[![Javadocs](http://www.javadoc.io/badge/net.java.jinput/jinput.svg)](http://www.javadoc.io/doc/net.java.jinput/jinput)
# Welcome to the Java Input API Project!
<p>The JInput Project hosts an implementation of an API for game controller
discovery and polled input. It is part of a suite of open-source technologies
initiated by the Game Technology Group at Sun Microsystems with intention of
making the development of high performance games in Java a reality.</p>
<p>The API itself is pure Java and presents a platform-neutral
completely portable model of controller discovery and polling.
It can handle arbitrary controllers and returns both human and
machine understandable descriptions of the inputs available.</p>
<p>The implementation hosted here also includes plug-ins to allow
the API to adapt to various specific platforms. These plug-ins
often contain a native code portion to interface to the host system.
</p>
## Getting Started
Include dependency in your project:
1. Maven - Easy way
-----
```xml
<dependency>
<groupId>net.java.jinput</groupId>
<artifactId>jinput</artifactId>
<version>2.0.7</version>
</dependency>
```
2. Build from sources - Experts only
-----
1. Download latest source from [here]({{ site.github.zip_url }}).
2. Build maven root project:
```bash
mvn build .
```
3. Include generated artifacts to your project.
## Usage
```java
/* Create an event object for the underlying plugin to populate */
Event event = new Event();
/* Get the available controllers */
Controller[] controllers = ControllerEnvironment.getDefaultEnvironment().getControllers();
for (int i = 0; i < controllers.length; i++) {
/* Remember to poll each one */
controllers[i].poll();
/* Get the controllers event queue */
EventQueue queue = controllers[i].getEventQueue();
/* For each object in the queue */
while (queue.getNextEvent(event)) {
/* Get event component */
Component comp = event.getComponent();
/* Process event (your awesome code) */
...
}
}
```
[More examples here](https://github.com/jinput/jinput/tree/master/examples/src/main/java/net/java/games/input/example).