| Holzchopf.Input: | Types | Modinfo | Source |
| TInput | Input Type. |
| Type TInput | |
| Description | Input Type. |
| Information | Stellt die modifizierten Funktionen zur Verfügung. Um darauf zugreifen zu können, muss ein TInput-Objekt erstellt werden, danach sind alle Eingabefunktionen als Methoden dieses Objektes verfügbar. |
| Example | SuperStrict Import Holzchopf.Input Graphics 400, 300 ' create input object to handle inputs Global Input:TInput = New TInput Global TimerL:TTimer = CreateTimer(2) Global TimerF:TTImer = CreateTimer(60) Global Timer:TTimer = TimerL While Not ( Input.KeyHit( KEY_ESCAPE ) Or Input.AppTerminate() ) Cls ' absolutely necessary: update input ' optional: Feed it with Millisecs() Input.Update( MilliSecs() ) If Input.KeyHit( KEY_ENTER ) If Timer = TimerL Timer = TimerF Else Timer = TimerL EndIf EndIf ' demo SetColor 255,255,255 DrawText "Mouse position:", 0, 0 DrawText "X: " +Input.MouseX(), 10, 16 DrawText "Y: " +Input.MouseY(), 100, 16 DrawText "Spacebar:", 0, 48 DrawText "Hit: " +Input.KeyHit( KEY_SPACE ), 10, 64 DrawText "Down: " +Input.KeyDown( KEY_SPACE ), 90, 64 DrawText "Up: " +Input.KeyUp( KEY_SPACE ), 170, 64 DrawText "Trigger: " +Input.KeyTrigger( KEY_SPACE ), 250, 64 SetColor 128, 255, 128 DrawText "And this module's special:", 0, 96 DrawText "Spacebar the 2nd! Same values, since it records", 0, 112 DrawText "states at Update() not at Key*-Function call", 0, 128 DrawText "Hit: " +Input.KeyHit( KEY_SPACE ), 10, 144 DrawText "Down: " +Input.KeyDown( KEY_SPACE ), 90, 144 DrawText "Up: " +Input.KeyUp( KEY_SPACE ), 170, 144 DrawText "Trigger: " +Input.KeyTrigger( KEY_SPACE ), 250, 144 DrawText "Also special:", 0, 176 DrawText "Mousespeed!", 0, 192 DrawText "X: " +Input.MouseXSpeed(), 10, 208 DrawText "Y: " +Input.MouseYSpeed(), 100, 208 DrawText "Z: " +Input.MouseZSpeed(), 190, 208 SetColor 255,204,0 DrawText "Press ENTER to turn laggy mode off /on", 0, 284 Flip WaitTimer( Timer ) Wend End |
| Methods Summary | |
|---|---|
| AppSuspended | Anwendung deaktiviert. |
| AppTerminate | Anwendung beendet. |
| FlushKeys | Tastatureingaben zurücksetzen. |
| FlushMouse | Mauseingaben zurücksetzen. |
| GetChar | Taste einlesen. |
| KeyDown | Prüft ob eine Taste gedrückt wird. |
| KeyHit | Prüft ob eine Taste gedrückt wurde. |
| KeyTrigger | Prüft ob eine Taste auslöste. |
| KeyUp | Prüft ob eine Taste losgelassen wurde. |
| MouseDown | Prüft ob eine Maustaste gedrückt wird. |
| MouseHit | Prüft ob eine Maustaste gedrückt wurde. |
| MouseUp | Prüft ob eine Maustaste losgelassen wurde. |
| MouseX | Mausposition X. |
| MouseXSpeed | Mausgeschwindigkeit X. |
| MouseY | Mausposition Y. |
| MouseYSpeed | Mausgeschwindigkeit Y. |
| MouseZ | Mausposition Z. |
| MouseZSpeed | Mausgeschwindigkeit Y. |
| Update | Aktualisiert alle Eingaben. |
| Method AppSuspended:Byte() | |
| Returns | True, wenn die Anwendung nicht fokussiert ist. |
| Description | Anwendung deaktiviert. |
| Method AppTerminate:Byte() | |
| Returns | True, wenn das Schliessensymbol gedrückt wurde. |
| Description | Anwendung beendet. |
| Method FlushKeys() | |
| Description | Tastatureingaben zurücksetzen. |
| Information | Löscht die Zustände aller Tasten. |
| Method FlushMouse() | |
| Description | Mauseingaben zurücksetzen. |
| Information | Löscht die Zustände aller Maustasten. |
| Method GetChar:Byte() | |
| Returns | ASCII-Wert der gedrückten Taste. |
| Description | Taste einlesen. |
| Method KeyDown:Byte( pKeyCode:Byte ) | |
| Returns | True, wenn pKeyCode beim letzten Update()-Aufruf gedrückt war. |
| Description | Prüft ob eine Taste gedrückt wird. |
| Information | Werte für pKeyCode sind in BRL.KeyCodes gespeichert. |
| Method KeyHit:Byte( pKeyCode:Byte ) | |
| Returns | Wie oft die Taste pKeyCode im letzten Update()-Intervall gedrückt wurde. |
| Description | Prüft ob eine Taste gedrückt wurde. |
| Information | Werte für pKeyCode sind in BRL.KeyCodes gespeichert. |
| Method KeyTrigger:Byte( pKeyCode:Byte ) | |
| Returns | Wie oft die Taste pKeyCode im letzten Update()-Intervall ausgelöst hat. |
| Description | Prüft ob eine Taste auslöste. |
| Information | Wenn eine Taste über längere Zeit gedrückt wird, löst sie nach einer
bestimmten Zeit in regelmässigen Abständen erneut aus. Werte für pKeyCode sind in BRL.KeyCodes gespeichert. |
| Method KeyUp:Byte( pKeyCode:Byte ) | |
| Returns | Wie oft die Taste pKeyCode im letzten Update()-Intervall losgelassen wurde. |
| Description | Prüft ob eine Taste losgelassen wurde. |
| Information | Werte für pKeyCode sind in BRL.KeyCodes gespeichert. |
| Method MouseDown:Byte( pKeyCode:Byte ) | |
| Returns | True, wenn pKeyCode beim letzten Update()-Aufruf gedrückt war. |
| Description | Prüft ob eine Maustaste gedrückt wird. |
| Information | Werte für pKeyCode sind in BRL.KeyCodes gespeichert. |
| Method MouseHit:Byte( pKeyCode:Byte ) | |
| Returns | Wie oft die Maustaste pKeyCode im letzten Update()-Intervall gedrückt wurde. |
| Description | Prüft ob eine Maustaste gedrückt wurde. |
| Information | Werte für pKeyCode sind in BRL.KeyCodes gespeichert. |
| Method MouseUp:Byte( pKeyCode:Byte ) | |
| Returns | Wie oft die Maustaste pKeyCode im letzten Update()-Intervall losgelassen wurde. |
| Description | Prüft ob eine Maustaste losgelassen wurde. |
| Information | Werte für pKeyCode sind in BRL.KeyCodes gespeichert. |
| Method MouseX:Int() | |
| Returns | X-Koordinate der Mausposition in Pixel. |
| Description | Mausposition X. |
| Method MouseXSpeed:Int() | |
| Returns | X-Verschiebung der Mausposition in Pixel. |
| Description | Mausgeschwindigkeit X. |
| Method MouseY:Int() | |
| Returns | Y-Koordinate der Mausposition in Pixel. |
| Description | Mausposition Y. |
| Method MouseYSpeed:Int() | |
| Returns | Y-Verschiebung der Mausposition in Pixel. |
| Description | Mausgeschwindigkeit Y. |
| Method MouseZ:Int() | |
| Returns | Mausradposition. |
| Description | Mausposition Z. |
| Method MouseZSpeed:Int() | |
| Returns | Veränderung der Mausradposition. |
| Description | Mausgeschwindigkeit Y. |
| Method Update( pTime:Int = 0 ) | |
| Description | Aktualisiert alle Eingaben. |
| Information | In Holzchopf.Input muss der Input manuell aktualisiert werden, damit
Funktionen wie KeyHit und MouseHit zuverlässige Werte liefern Damit auch die zeitgesteuerte Funktion KeyTrigger funktioniert, muss der Update-Funktion die Laufzeit übergeben werden. Die Laufzeit kann mit MilliSecs() ermittelt werden. |
| Version | 1.00 |
|---|---|
| Author | Holzchopf |
| License | Public Domain |