SerialConnect: fix return and backspace keys.
This commit is contained in:
parent
815d18fb53
commit
604dad9490
@ -46,7 +46,7 @@ void SerialApp::ReadyToRun()
|
||||
|
||||
void SerialApp::MessageReceived(BMessage* message)
|
||||
{
|
||||
switch(message->what)
|
||||
switch (message->what)
|
||||
{
|
||||
case kMsgOpenPort:
|
||||
{
|
||||
@ -88,10 +88,6 @@ void SerialApp::MessageReceived(BMessage* message)
|
||||
&size) != B_OK)
|
||||
break;
|
||||
|
||||
if (bytes[0] == '\n') {
|
||||
size = 2;
|
||||
bytes = "\r\n";
|
||||
}
|
||||
fSerialPort.Write(bytes, size);
|
||||
break;
|
||||
}
|
||||
|
@ -161,6 +161,10 @@ TermView::KeyDown(const char* bytes, int32 numBytes)
|
||||
numBytes = 3;
|
||||
bytes = "\x1B[D";
|
||||
break;
|
||||
case B_BACKSPACE:
|
||||
numBytes = 1;
|
||||
bytes = "\x7F";
|
||||
break;
|
||||
}
|
||||
|
||||
// Send the bytes to the serial port
|
||||
|
Loading…
x
Reference in New Issue
Block a user