gzorzi (Normal User)
Newbie
Messaggi: 1
Iscritto: 15/05/2012
|
Buongiorno, ho una routine che gestisce l'evento keypress. Questa routine aggiunge in una arraylist (keyBuffer) ogni singolo carattere selezionato e chiama
la sub KeyPressManager, la quale manda un carattere su seriale, carattere che dovrebbe scatenare un altro handles della seriale. Il problema č che l'handle scatenato dalla pressione del tasto inibisce lo scatenarsi del secondo handle dovuto alla scrittura su seriale, fintanto che la sub keypressManager non finisce.
In pratica fino a quando io sono nella sub keypreemanager, nessun altro handle viene gestito. Come posso risolvere? Grazie
Codice sorgente - presumibilmente VB.NET |
Private Sub KeyPress(ByVal sender As Object, _ ByVal e As Windows.Forms.KeyPressEventArgs) Handles txtTerminal.KeyPress KeysBuffer.Add(e) KeyPressManager() End Sub Private Sub KeyPressManager() Dim e As Windows.Forms.KeyPressEventArgs PressManager = True While KeysBuffer.Count > 0 e = CType(KeysBuffer.Item(0), KeyPressEventArgs) terminal.writeChar(e.KeyChar) e.Handled = True end while
|
|