Down(iKeyCode, iShift)
      Case WM_KEYUP
          iShift = piGetShiftState()
          RaiseEvent KeyUp(iKeyCode, iShift)
      Case WM_CHAR
          iKeyAscii = (wParam And &amp;HFF)
          iOrigKeyAscii = iKeyAscii
          RaiseEvent KeyPress(iKeyAscii)
          If (iKeyAscii = 0) Then
              plKeyEvent = 1
          ElseIf (iKeyAscii &lt;&gt; iOrigKeyAscii) Then
              SendMessageByLong lhWnd, WM_CHAR, iKeyAscii, 0
              plKeyEvent = 1
          End If
      End Select
   