Defines abstract classes for user and general inputs to the application.

Implemented independantly for each platforms and technologies.

Introduced classes

interface InputEvent

mnit :: InputEvent

Input to the App, propagated through App::input.
interface KeyEvent

mnit :: KeyEvent

Keyboard or other keys event
interface MobileKeyEvent

mnit :: MobileKeyEvent

Mobile hardware (or pseudo hardware) event
interface MotionEvent

mnit :: MotionEvent

A motion event on screen composed of many PointerEvent
interface PointerEvent

mnit :: PointerEvent

Mouse and touch input events
interface QuitEvent

mnit :: QuitEvent

Quit event, used for window close button
interface SensorEvent

mnit :: SensorEvent

Sensor events like accelerometer, gyroscope etc for mobile apps
interface TouchEvent

mnit :: TouchEvent

Specific touch event

All class definitions

interface InputEvent

mnit $ InputEvent

Input to the App, propagated through App::input.
interface KeyEvent

mnit $ KeyEvent

Keyboard or other keys event
interface MobileKeyEvent

mnit $ MobileKeyEvent

Mobile hardware (or pseudo hardware) event
interface MotionEvent

mnit $ MotionEvent

A motion event on screen composed of many PointerEvent
interface PointerEvent

mnit $ PointerEvent

Mouse and touch input events
interface QuitEvent

mnit $ QuitEvent

Quit event, used for window close button
interface SensorEvent

mnit $ SensorEvent

Sensor events like accelerometer, gyroscope etc for mobile apps
interface TouchEvent

mnit $ TouchEvent

Specific touch event
package_diagram mnit::input input core core mnit::input->core android::input_events input_events android::input_events->mnit::input gamnit::display display gamnit::display->mnit::input android::gamepad gamepad android::gamepad->android::input_events gamnit::gamnit_android gamnit_android gamnit::gamnit_android->android::input_events android::gamepad... ... android::gamepad...->android::gamepad gamnit::gamnit_android... ... gamnit::gamnit_android...->gamnit::gamnit_android gamnit::textures textures gamnit::textures->gamnit::display gamnit::programs programs gamnit::programs->gamnit::display gamnit::egl egl gamnit::egl->gamnit::display gamnit::cameras cameras gamnit::cameras->gamnit::display gamnit::textures... ... gamnit::textures...->gamnit::textures gamnit::programs... ... gamnit::programs...->gamnit::programs gamnit::egl... ... gamnit::egl...->gamnit::egl gamnit::cameras... ... gamnit::cameras...->gamnit::cameras

Ancestors

module abstract_collection

core :: abstract_collection

Abstract collection classes and services.
module abstract_text

core :: abstract_text

Abstract class for manipulation of sequences of characters
module array

core :: array

This module introduces the standard array structure.
module bitset

core :: bitset

Services to handle BitSet
module bytes

core :: bytes

Services for byte streams and arrays
module circular_array

core :: circular_array

Efficient data structure to access both end of the sequence.
module codec_base

core :: codec_base

Base for codecs to use with streams
module codecs

core :: codecs

Group module for all codec-related manipulations
module collection

core :: collection

This module define several collection classes.
module environ

core :: environ

Access to the environment variables of the process
module error

core :: error

Standard error-management infrastructure.
module exec

core :: exec

Invocation and management of operating system sub-processes.
module file

core :: file

File manipulations (create, read, write, etc.)
module fixed_ints

core :: fixed_ints

Basic integers of fixed-precision
module fixed_ints_text

core :: fixed_ints_text

Text services to complement fixed_ints
module flat

core :: flat

All the array-based text representations
module gc

core :: gc

Access to the Nit internal garbage collection mechanism
module hash_collection

core :: hash_collection

Introduce HashMap and HashSet.
module iso8859_1

core :: iso8859_1

Codec for ISO8859-1 I/O
module kernel

core :: kernel

Most basic classes and methods.
module list

core :: list

This module handle double linked lists
module math

core :: math

Mathematical operations
module native

core :: native

Native structures for text and bytes
module numeric

core :: numeric

Advanced services for Numeric types
module protocol

core :: protocol

module queue

core :: queue

Queuing data structures and wrappers
module range

core :: range

Module for range of discrete objects.
module re

core :: re

Regular expression support for all services based on Pattern
module ropes

core :: ropes

Tree-based representation of a String.
module sorter

core :: sorter

This module contains classes used to compare things and sorts arrays.
module stream

core :: stream

Input and output streams of characters
module text

core :: text

All the classes and methods related to the manipulation of text entities
module time

core :: time

Management of time and dates
module union_find

core :: union_find

union–find algorithm using an efficient disjoint-set data structure
module utf8

core :: utf8

Codec for UTF-8 I/O

Parents

module core

core :: core

Standard classes and methods used by default by Nit programs and libraries.

Children

module display

gamnit :: display

Abstract display services
module input_events

android :: input_events

Pointer and hardware key events

Descendants

module a_star-m

a_star-m

module android19

gamnit :: android19

Variation using features from Android API 19
module bmfont

gamnit :: bmfont

Parse Angel Code BMFont format and draw text
module camera_control

gamnit :: camera_control

Simple camera control for user, as the method accept_scroll_and_zoom
module camera_control_android

gamnit :: camera_control_android

Two fingers camera manipulation, pinch to zoom and slide to scroll
module camera_control_linux

gamnit :: camera_control_linux

Mouse wheel and middle mouse button to control camera
module cameras

gamnit :: cameras

Camera services producing Model-View-Projection matrices
module cameras_cache

gamnit :: cameras_cache

Cache the Matrix produced by Camera::mvp_matrix
module cardboard

gamnit :: cardboard

Update the orientation of world_camera at each frame using the head position given by android::cardboard
module depth

gamnit :: depth

Framework for 3D games in Nit
module depth_core

gamnit :: depth_core

Base entities of the depth 3D game framework
module display_android

gamnit :: display_android

Gamnit display implementation for Android
module display_ios

gamnit :: display_ios

Gamnit display implementation for iOS
module display_linux

gamnit :: display_linux

Gamnit display implementation for GNU/Linux using egl, sdl and x11
module dynamic_resolution

gamnit :: dynamic_resolution

Virtual screen with a resolution independent from the real screen
module egl

gamnit :: egl

Use of EGL to implement Gamnit on GNU/Linux and Android
module flat

gamnit :: flat

Simple API for 2D games, built around Sprite and App::update
module flat_core

gamnit :: flat_core

Core services for the flat API for 2D games
module font

gamnit :: font

Abstract font drawing services, implemented by bmfont and tileset
module gamepad

android :: gamepad

Support for gamepad events (over Bluetooth or USB)
module gamnit

gamnit :: gamnit

Game and multimedia framework for Nit
module gamnit_android

gamnit :: gamnit_android

Support services for Gamnit on Android
module gamnit_ios

gamnit :: gamnit_ios

Support services for gamnit on iOS
module gamnit_linux

gamnit :: gamnit_linux

Support services for Gamnit on GNU/Linux
module input_ios

gamnit :: input_ios

Gamnit event support for iOS
module keys

gamnit :: keys

Simple service keeping track of which keys are currently pressed
module limit_fps

gamnit :: limit_fps

Frame-rate control for applications
module model_dimensions

gamnit :: model_dimensions

Dimensions related services for Model and Mesh
module more_lights

gamnit :: more_lights

More implementations of Light
module more_materials

gamnit :: more_materials

Various material implementations
module more_meshes

gamnit :: more_meshes

More simple geometric meshes
module more_models

gamnit :: more_models

Services to load models from the assets folder
module particles

gamnit :: particles

Particle effects
module programs

gamnit :: programs

Services for graphical programs with shaders, attributes and uniforms
module selection

gamnit :: selection

Select Actor from a screen coordinate
module sensors

android :: sensors

Access Android sensors
module shadow

gamnit :: shadow

Shadow mapping using a depth texture
module stereoscopic_view

gamnit :: stereoscopic_view

Refine EulerCamera and App::frame_core_draw to get a stereoscopic view
module textures

gamnit :: textures

Load textures, create subtextures and manage their life-cycle
module tileset

gamnit :: tileset

Support for TileSet, TileSetFont and drawing text with TextSprites
module virtual_gamepad

gamnit :: virtual_gamepad

Virtual gamepad mapped to keyboard keys for quick and dirty mobile support
module vr

gamnit :: vr

VR support for gamnit depth, for Android only
# Defines abstract classes for user and general inputs to the application.
# Implemented independantly for each platforms and technologies.
module input

import android::input_events is conditional(android)

# Input to the App, propagated through `App::input`.
interface InputEvent
end

# Mouse and touch input events
interface PointerEvent
	super InputEvent

	# X position on screen (in pixels)
	fun x: Float is abstract

	# Y position on screen (in pixels)
	fun y: Float is abstract

	# Is down? either going down or already down
	fun pressed: Bool is abstract

	# Is it not currently pressed down? The opposite of `pressed`.
	fun depressed: Bool do return not pressed

	# Is this a movement event?
	fun is_move: Bool is abstract

	# Unique identifier of this pointer among other active pointers
	#
	# This value is useful to differentiate between pointers (or fingers) on
	# multi-touch systems. This value does not change for the same pointer
	# while it touches the screen.
	fun pointer_id: Int do return 0
end

# A motion event on screen composed of many `PointerEvent`
#
# Example of a `MotionEvent` a gesture such as pinching using two fingers.
interface MotionEvent
	super InputEvent

	# A pointer just went down?
	fun just_went_down: Bool is abstract

	# Which pointer is down, if any
	fun down_pointer: nullable PointerEvent is abstract
end

# Specific touch event
interface TouchEvent
	super PointerEvent

	# Pressure level of input
	fun pressure: Float is abstract
end

# Keyboard or other keys event
interface KeyEvent
	super InputEvent

	# Key is currently down?
	fun is_down: Bool is abstract

	# Key is currently up?
	fun is_up: Bool do return not is_down

	# Key is the up arrow key?
	fun is_arrow_up: Bool is abstract

	# Key is the left arrow key?
	fun is_arrow_left: Bool is abstract

	# Key is the down arrow key?
	fun is_arrow_down: Bool is abstract

	# Key is the right arrow key?
	fun is_arrow_right: Bool is abstract

	# Key code, is plateform specific
	fun code: Int is abstract

	# Get Char value of key, if any
	fun to_c: nullable Char is abstract

	# Name of the key that raised `self`
	#
	# Use mainly for debug since it is implementation dependent.
	fun name: String is abstract
end

# Mobile hardware (or pseudo hardware) event
interface MobileKeyEvent
	super KeyEvent

	# Key is back button? (mostly for Android)
	fun is_back_key: Bool is abstract

	# Key is menu button? (mostly for Android)
	fun is_menu_key: Bool is abstract

	# Key is search button? (mostly for Android)
	fun is_search_key: Bool is abstract

	# Key is home button? (mostly for Android)
	fun is_home_key: Bool is abstract
end

# Sensor events like accelerometer, gyroscope etc for mobile apps
interface SensorEvent
	super InputEvent
end

# Quit event, used for window close button
interface QuitEvent
	super InputEvent
end
lib/mnit/input.nit:15,1--132,3