Individuare i tasti premuti della tastiera mediante il Componente gb.ncurses
Vai alla navigazione
Vai alla ricerca
Le risorse del Componente gb.ncurses di Gambas consentono, fra l'altro, di individuare il tasto della tastiera premuto.
Mostriamo un semplice esempio pratico:
Private wn As Window Public Sub Main() ' Non mostra il tasto premuto della tastiera: Screen.Echo = False With wn = New Window(True, 0, 0, 300, 20) As "WinCurses" .Border = Border.ACS .Background = Color.Green .Caption = "Console ncurses" .SetFocus() End With End Public Sub WinCurses_Read() Dim tasto As Integer With wn ' Intercetta il tasto premuto della tastiera: tasto = .Read() .Print(Chr(tasto), 1, 1) .Raise() End With End