check_contrib: additional rules are given by arguments.
[nit.git] / lib / mnit_input.nit
index 0536660..ea035b3 100644 (file)
@@ -37,7 +37,9 @@ interface PointerEvent
        fun depressed: Bool is abstract
 end
 
-# Pointer motion event, mais concern many events
+# 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
 
@@ -64,7 +66,7 @@ interface KeyEvent
        fun is_down: Bool is abstract
 
        # Key is currently up?
-       fun is_up: Bool is abstract
+       fun is_up: Bool do return not is_down
 
        # Key is the up arrow key?
        fun is_arrow_up: Bool is abstract
@@ -83,6 +85,11 @@ interface KeyEvent
 
        # 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