Fix KeyDown/KeyUp calls so that we don't always get numBytes = 0.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12062 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz 2005-03-27 02:07:02 +00:00
parent d5373f593a
commit ed16bb7885

View File

@ -795,7 +795,7 @@ void BWindow::DispatchMessage(BMessage *msg, BHandler *target)
if ( !handleKeyDown( string[0], (uint32)modifiers) ) if ( !handleKeyDown( string[0], (uint32)modifiers) )
{ {
if(fFocus) if(fFocus)
fFocus->KeyDown( string, strlen(string)-1 ); fFocus->KeyDown( string, strlen(string) );
else else
printf("Adi: No Focus\n"); printf("Adi: No Focus\n");
} }
@ -808,7 +808,7 @@ void BWindow::DispatchMessage(BMessage *msg, BHandler *target)
msg->FindString( "bytes", &string ); msg->FindString( "bytes", &string );
if(fFocus) if(fFocus)
fFocus->KeyUp( string, strlen(string)-1 ); fFocus->KeyUp( string, strlen(string) );
break; break;
} }
@ -2713,7 +2713,7 @@ bool BWindow::handleKeyDown( const char key, uint32 modifiers){
const char *chars; // just to be sure const char *chars; // just to be sure
CurrentMessage()->FindString("bytes", &chars); CurrentMessage()->FindString("bytes", &chars);
DefaultButton()->KeyDown( chars, strlen(chars)-1 ); DefaultButton()->KeyDown( chars, strlen(chars) );
return true; return true;
} }