SerialConnect: fix return and backspace keys.

This commit is contained in:
Adrien Destugues 2014-08-22 10:55:55 +02:00
parent 815d18fb53
commit 604dad9490
2 changed files with 5 additions and 5 deletions

View File

@ -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;
}

View File

@ -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