Keyboard Input

Monkey Forums/Monkey Bug Reports/Keyboard Input

Paul - Taiphoz(Posted 2015) [#1]
Original post by cgrossi

I suspect this might be a Driver issue but it could just as easily be a bug.

Test code.
Strict

Import mojo
Global teclas:Bool=False

Function Main:Int()
	New MyApp()
	Return 0
End

Class MyApp Extends App
 
	
	Method OnCreate:Int()
		SetUpdateRate(60)
		Return 0
	End
	
	Method OnUpdate:Int()
		Local L:Int=KeyDown(KEY_LEFT),R:Int=KeyDown(KEY_RIGHT)
		If L=1 And R=1 Then
			teclas=True	
		Else
			teclas=False
		Endif
		Return 0
	End
	
	Method OnRender:Int()
		Cls
		DrawText("Steps",10,10)
		DrawText("1 . Press and Hold, Left Arrow and Right Arrow to get a 1 ",10,30)
		DrawText("2 . Repeat above but first press and hold UP or Num 5 (could fail on other keys as well)",10,50)
		DrawText("Result "+Int(teclas),10,70)
		Return 0
	End
End



SLotman(Posted 2015) [#2]
As explained here this is not a software (or even a driver) bug. It is a hardware related problem - so there isn't anything Mark, or anyone can do about it through code.