Hi All,

I'd like to drive keyboard/mouse devices and add the
WaitForInput of EFI_SIMPLE_POINTER_PROTOCOL into gBS->WaitForEvent(). So I
wrote a sample code below.
I found if I keep the "*Print(L"\n");*" in my code, both RelativeMovementX
and RelativeMovementY could be printed.
But once removing "*Print(L"\n");*", the Status of "Not Ready" would be
returned by MouseInterface->GetState.
I have no idea why the "Print \n" can cause the difference.
**I ran the code in my server with EFI shell.
Can anyone help me on this? Thanks.
**
--
*Timer[0] = MouseInterface->WaitForInput;
Timer[1] = gST->ConIn->WaitForKey;
while (1) {
  UINTN index;
  gBS->WaitForEvent(2, Timer, &index);
  Print(L"\n");*
*  if (index == 0) {
       Status = MouseInterface->GetState(MouseInterface, &MouseState);*
*       if (!EFI_ERROR (Status)) {
            Print(L"(%d,%d)\n", MouseState.RelativeMovementX,
                        MouseState.RelativeMovementY);
       } else {*
*            Print(L"%r\n", Status);*
*       }
  } else if (index == 1) {
      Status = gST->ConIn->ReadKeyStroke(gST->ConIn, &Key);
      if (!EFI_ERROR (Status)) {
           Print(L"[%X,%X]\n", Key.ScanCode, Key.UnicodeChar);
           if (Key.ScanCode == SCAN_ESC) {
                break;
           }
      }
   } else {}*
* }*
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to