Made modifications to send keyboard messages to client applications

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10888 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
DarkWyrm
2005-01-19 18:59:41 +00:00
parent aea21365e7
commit 7a5829aab1
2 changed files with 209 additions and 64 deletions
+15 -5
View File
@@ -280,7 +280,7 @@ void VDWindow::MessageReceived(BMessage *msg)
// 10) int8[16] state of all keys
bigtime_t systime;
int32 scancode, asciicode,repeatcount,modifiers;
int8 utf8data[3];
int8 utf8data[4];
BString string;
int8 keyarray[16];
@@ -289,9 +289,14 @@ void VDWindow::MessageReceived(BMessage *msg)
msg->FindInt32("be:key_repeat",&repeatcount);
msg->FindInt32("modifiers",&modifiers);
msg->FindInt32("raw_char",&asciicode);
msg->FindInt8("byte",0,utf8data);
msg->FindInt8("byte",1,utf8data+1);
msg->FindInt8("byte",2,utf8data+2);
if(msg->FindInt8("byte",1,utf8data+1)!=B_OK)
utf8data[1]=0;
if(msg->FindInt8("byte",1,utf8data+2)!=B_OK)
utf8data[2]=0;
if(msg->FindInt8("byte",1,utf8data+3)!=B_OK)
utf8data[3]=0;
msg->FindString("bytes",&string);
for(int8 i=0;i<15;i++)
msg->FindInt8("states",i,&keyarray[i]);
@@ -331,8 +336,12 @@ void VDWindow::MessageReceived(BMessage *msg)
msg->FindInt32("raw_char",&asciicode);
msg->FindInt32("modifiers",&modifiers);
msg->FindInt8("byte",0,utf8data);
msg->FindInt8("byte",1,utf8data+1);
msg->FindInt8("byte",2,utf8data+2);
if(msg->FindInt8("byte",1,utf8data+1)!=B_OK)
utf8data[1]=0;
if(msg->FindInt8("byte",1,utf8data+2)!=B_OK)
utf8data[2]=0;
if(msg->FindInt8("byte",1,utf8data+3)!=B_OK)
utf8data[3]=0;
msg->FindString("bytes",&string);
for(int8 i=0;i<15;i++)
msg->FindInt8("states",i,&keyarray[i]);
@@ -413,6 +422,7 @@ void VDWindow::MessageReceived(BMessage *msg)
msg->FindInt32("be:old_modifiers",&oldmodifiers);
for(int8 i=0;i<15;i++)
msg->FindInt8("states",i,&keyarray[i]);
view->serverlink->StartMessage(B_MODIFIERS_CHANGED);
view->serverlink->Attach(&systime,sizeof(bigtime_t));
view->serverlink->Attach(scancode);