public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* EmulatorPkg/Unix/Host fixed numeric pad function
@ 2018-11-18 14:53 Liu Yu
  2018-11-19  0:52 ` Gao, Liming
  0 siblings, 1 reply; 3+ messages in thread
From: Liu Yu @ 2018-11-18 14:53 UTC (permalink / raw)
  To: "afish@apple.com;  jordan.l.justen@intel.com ; ruiyu.ni"@intel.com
  Cc: edk2-devel@lists.01.org

add numeric pad key map

Signed-off-by: Pedroa Liu <pedroa.liu@outlook.com>
---
  EmulatorPkg/Unix/Host/X11GraphicsWindow.c | 54 ++++++++++++++++++-----
  1 file changed, 43 insertions(+), 11 deletions(-)

diff --git a/EmulatorPkg/Unix/Host/X11GraphicsWindow.c 
b/EmulatorPkg/Unix/Host/X11GraphicsWindow.c
index a3cc28c223..573f0f1bfd 100644
--- a/EmulatorPkg/Unix/Host/X11GraphicsWindow.c
+++ b/EmulatorPkg/Unix/Host/X11GraphicsWindow.c
@@ -271,7 +271,14 @@ handleKeyEvent (
      }
    }

-  // Skipping EFI_MENU_KEY_PRESSED and EFI_SYS_REQ_PRESSED
+  if ((ev->xkey.state & Mod2Mask) == 0) {
+    Drv->KeyState.KeyToggleState &= ~EFI_NUM_LOCK_ACTIVE;
+  } else {
+    if (Make) {
+      Drv->KeyState.KeyToggleState |= EFI_NUM_LOCK_ACTIVE;
+    }
+  }
+ // Skipping EFI_MENU_KEY_PRESSED and EFI_SYS_REQ_PRESSED

    switch (*KeySym) {
    case XK_Control_R:
@@ -328,35 +335,70 @@ handleKeyEvent (
      break;

    case XK_KP_Home:
+    if ((Drv->KeyState.KeyShiftState & (EFI_LEFT_SHIFT_PRESSED | 
EFI_RIGHT_SHIFT_PRESSED)) ^ (Drv->KeyState.KeyToggleState & 
(EFI_NUM_LOCK_ACTIVE))) {
+      KeyData.Key.UnicodeChar = L'7'; break;
+    }
    case XK_Home:       KeyData.Key.ScanCode = SCAN_HOME; break;

    case XK_KP_End:
+    if ((Drv->KeyState.KeyShiftState & (EFI_LEFT_SHIFT_PRESSED | 
EFI_RIGHT_SHIFT_PRESSED)) ^ (Drv->KeyState.KeyToggleState & 
(EFI_NUM_LOCK_ACTIVE))) {
+      KeyData.Key.UnicodeChar = L'1'; break;
+    }
    case XK_End:        KeyData.Key.ScanCode = SCAN_END; break;

    case XK_KP_Left:
+    if ((Drv->KeyState.KeyShiftState & (EFI_LEFT_SHIFT_PRESSED | 
EFI_RIGHT_SHIFT_PRESSED)) ^ (Drv->KeyState.KeyToggleState & 
(EFI_NUM_LOCK_ACTIVE))) {
+      KeyData.Key.UnicodeChar = L'4'; break;
+    }
    case XK_Left:       KeyData.Key.ScanCode = SCAN_LEFT; break;

    case XK_KP_Right:
+    if((Drv->KeyState.KeyShiftState & (EFI_LEFT_SHIFT_PRESSED | 
EFI_RIGHT_SHIFT_PRESSED)) ^ (Drv->KeyState.KeyToggleState & 
(EFI_NUM_LOCK_ACTIVE)) ){
+      KeyData.Key.UnicodeChar = L'6'; break;
+    }
    case XK_Right:      KeyData.Key.ScanCode = SCAN_RIGHT; break;

    case XK_KP_Up:
+    if((Drv->KeyState.KeyShiftState & (EFI_LEFT_SHIFT_PRESSED | 
EFI_RIGHT_SHIFT_PRESSED)) ^ (Drv->KeyState.KeyToggleState & 
(EFI_NUM_LOCK_ACTIVE)) ){
+      KeyData.Key.UnicodeChar = L'8'; break;
+    }
    case XK_Up:         KeyData.Key.ScanCode = SCAN_UP; break;

    case XK_KP_Down:
+    if((Drv->KeyState.KeyShiftState & (EFI_LEFT_SHIFT_PRESSED | 
EFI_RIGHT_SHIFT_PRESSED)) ^ (Drv->KeyState.KeyToggleState & 
(EFI_NUM_LOCK_ACTIVE)) ){
+      KeyData.Key.UnicodeChar = L'2'; break;
+    }
    case XK_Down:       KeyData.Key.ScanCode = SCAN_DOWN; break;

    case XK_KP_Delete:
+    if((Drv->KeyState.KeyShiftState & (EFI_LEFT_SHIFT_PRESSED | 
EFI_RIGHT_SHIFT_PRESSED)) ^ (Drv->KeyState.KeyToggleState & 
(EFI_NUM_LOCK_ACTIVE)) ){
+      KeyData.Key.UnicodeChar = L'.'; break;
+    }
    case XK_Delete:       KeyData.Key.ScanCode = SCAN_DELETE; break;

    case XK_KP_Insert:
+    if((Drv->KeyState.KeyShiftState & (EFI_LEFT_SHIFT_PRESSED | 
EFI_RIGHT_SHIFT_PRESSED)) ^ (Drv->KeyState.KeyToggleState & 
(EFI_NUM_LOCK_ACTIVE)) ){
+      KeyData.Key.UnicodeChar = L'0';break;
+    }
    case XK_Insert:     KeyData.Key.ScanCode = SCAN_INSERT; break;

    case XK_KP_Page_Up:
+    if((Drv->KeyState.KeyShiftState & (EFI_LEFT_SHIFT_PRESSED | 
EFI_RIGHT_SHIFT_PRESSED)) ^ (Drv->KeyState.KeyToggleState & 
(EFI_NUM_LOCK_ACTIVE)) ){
+      KeyData.Key.UnicodeChar = L'9'; break;
+    }
    case XK_Page_Up:    KeyData.Key.ScanCode = SCAN_PAGE_UP; break;

    case XK_KP_Page_Down:
+    if((Drv->KeyState.KeyShiftState & (EFI_LEFT_SHIFT_PRESSED | 
EFI_RIGHT_SHIFT_PRESSED)) ^ (Drv->KeyState.KeyToggleState & 
(EFI_NUM_LOCK_ACTIVE)) ){
+      KeyData.Key.UnicodeChar = L'3'; break;
+    }
    case XK_Page_Down:  KeyData.Key.ScanCode = SCAN_PAGE_DOWN; break;

+  case XK_KP_Begin:
+    if((Drv->KeyState.KeyShiftState & (EFI_LEFT_SHIFT_PRESSED | 
EFI_RIGHT_SHIFT_PRESSED)) ^ (Drv->KeyState.KeyToggleState & 
(EFI_NUM_LOCK_ACTIVE)) ){
+      KeyData.Key.UnicodeChar = L'5'; break;
+    }
+    /* no map efi scan code */ break;
    case XK_Escape:     KeyData.Key.ScanCode = SCAN_ESC; break;

    case XK_Pause:      KeyData.Key.ScanCode = SCAN_PAUSE; break;
@@ -431,16 +473,6 @@ handleKeyEvent (
    case XK_KP_Decimal    : KeyData.Key.UnicodeChar = L'.'; break;
    case XK_KP_Divide     : KeyData.Key.UnicodeChar = L'/'; break;

-  case XK_KP_0    : KeyData.Key.UnicodeChar = L'0'; break;
-  case XK_KP_1    : KeyData.Key.UnicodeChar = L'1'; break;
-  case XK_KP_2    : KeyData.Key.UnicodeChar = L'2'; break;
-  case XK_KP_3    : KeyData.Key.UnicodeChar = L'3'; break;
-  case XK_KP_4    : KeyData.Key.UnicodeChar = L'4'; break;
-  case XK_KP_5    : KeyData.Key.UnicodeChar = L'5'; break;
-  case XK_KP_6    : KeyData.Key.UnicodeChar = L'6'; break;
-  case XK_KP_7    : KeyData.Key.UnicodeChar = L'7'; break;
-  case XK_KP_8    : KeyData.Key.UnicodeChar = L'8'; break;
-  case XK_KP_9    : KeyData.Key.UnicodeChar = L'9'; break;

    default:
      ;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: EmulatorPkg/Unix/Host fixed numeric pad function
  2018-11-18 14:53 EmulatorPkg/Unix/Host fixed numeric pad function Liu Yu
@ 2018-11-19  0:52 ` Gao, Liming
  2018-11-19  6:11   ` 答复: " Liu Yu
  0 siblings, 1 reply; 3+ messages in thread
From: Gao, Liming @ 2018-11-19  0:52 UTC (permalink / raw)
  To: Liu Yu,
	"afish@apple.com; jordan.l.justen@intel.com ; ruiyu.ni"@intel.com
  Cc: edk2-devel@lists.01.org

Yu:
  Could you add the reason why make this change? 

  Besides, please add Contributed-under: TianoCore Contribution Agreement 1.1 before Signed-off-by. And, add Cc: to the package maintainers. Then, use git send-email to send this patch. 

Thanks
Liming
>-----Original Message-----
>From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Liu
>Yu
>Sent: Sunday, November 18, 2018 10:54 PM
>To: "afish@apple.com; jordan.l.justen@intel.com ; ruiyu.ni"@intel.com
>Cc: edk2-devel@lists.01.org
>Subject: [edk2] EmulatorPkg/Unix/Host fixed numeric pad function
>
>add numeric pad key map
>
>Signed-off-by: Pedroa Liu <pedroa.liu@outlook.com>
>---
>  EmulatorPkg/Unix/Host/X11GraphicsWindow.c | 54 ++++++++++++++++++-
>----
>  1 file changed, 43 insertions(+), 11 deletions(-)
>
>diff --git a/EmulatorPkg/Unix/Host/X11GraphicsWindow.c
>b/EmulatorPkg/Unix/Host/X11GraphicsWindow.c
>index a3cc28c223..573f0f1bfd 100644
>--- a/EmulatorPkg/Unix/Host/X11GraphicsWindow.c
>+++ b/EmulatorPkg/Unix/Host/X11GraphicsWindow.c
>@@ -271,7 +271,14 @@ handleKeyEvent (
>      }
>    }
>
>-  // Skipping EFI_MENU_KEY_PRESSED and EFI_SYS_REQ_PRESSED
>+  if ((ev->xkey.state & Mod2Mask) == 0) {
>+    Drv->KeyState.KeyToggleState &= ~EFI_NUM_LOCK_ACTIVE;
>+  } else {
>+    if (Make) {
>+      Drv->KeyState.KeyToggleState |= EFI_NUM_LOCK_ACTIVE;
>+    }
>+  }
>+ // Skipping EFI_MENU_KEY_PRESSED and EFI_SYS_REQ_PRESSED
>
>    switch (*KeySym) {
>    case XK_Control_R:
>@@ -328,35 +335,70 @@ handleKeyEvent (
>      break;
>
>    case XK_KP_Home:
>+    if ((Drv->KeyState.KeyShiftState & (EFI_LEFT_SHIFT_PRESSED |
>EFI_RIGHT_SHIFT_PRESSED)) ^ (Drv->KeyState.KeyToggleState &
>(EFI_NUM_LOCK_ACTIVE))) {
>+      KeyData.Key.UnicodeChar = L'7'; break;
>+    }
>    case XK_Home:       KeyData.Key.ScanCode = SCAN_HOME; break;
>
>    case XK_KP_End:
>+    if ((Drv->KeyState.KeyShiftState & (EFI_LEFT_SHIFT_PRESSED |
>EFI_RIGHT_SHIFT_PRESSED)) ^ (Drv->KeyState.KeyToggleState &
>(EFI_NUM_LOCK_ACTIVE))) {
>+      KeyData.Key.UnicodeChar = L'1'; break;
>+    }
>    case XK_End:        KeyData.Key.ScanCode = SCAN_END; break;
>
>    case XK_KP_Left:
>+    if ((Drv->KeyState.KeyShiftState & (EFI_LEFT_SHIFT_PRESSED |
>EFI_RIGHT_SHIFT_PRESSED)) ^ (Drv->KeyState.KeyToggleState &
>(EFI_NUM_LOCK_ACTIVE))) {
>+      KeyData.Key.UnicodeChar = L'4'; break;
>+    }
>    case XK_Left:       KeyData.Key.ScanCode = SCAN_LEFT; break;
>
>    case XK_KP_Right:
>+    if((Drv->KeyState.KeyShiftState & (EFI_LEFT_SHIFT_PRESSED |
>EFI_RIGHT_SHIFT_PRESSED)) ^ (Drv->KeyState.KeyToggleState &
>(EFI_NUM_LOCK_ACTIVE)) ){
>+      KeyData.Key.UnicodeChar = L'6'; break;
>+    }
>    case XK_Right:      KeyData.Key.ScanCode = SCAN_RIGHT; break;
>
>    case XK_KP_Up:
>+    if((Drv->KeyState.KeyShiftState & (EFI_LEFT_SHIFT_PRESSED |
>EFI_RIGHT_SHIFT_PRESSED)) ^ (Drv->KeyState.KeyToggleState &
>(EFI_NUM_LOCK_ACTIVE)) ){
>+      KeyData.Key.UnicodeChar = L'8'; break;
>+    }
>    case XK_Up:         KeyData.Key.ScanCode = SCAN_UP; break;
>
>    case XK_KP_Down:
>+    if((Drv->KeyState.KeyShiftState & (EFI_LEFT_SHIFT_PRESSED |
>EFI_RIGHT_SHIFT_PRESSED)) ^ (Drv->KeyState.KeyToggleState &
>(EFI_NUM_LOCK_ACTIVE)) ){
>+      KeyData.Key.UnicodeChar = L'2'; break;
>+    }
>    case XK_Down:       KeyData.Key.ScanCode = SCAN_DOWN; break;
>
>    case XK_KP_Delete:
>+    if((Drv->KeyState.KeyShiftState & (EFI_LEFT_SHIFT_PRESSED |
>EFI_RIGHT_SHIFT_PRESSED)) ^ (Drv->KeyState.KeyToggleState &
>(EFI_NUM_LOCK_ACTIVE)) ){
>+      KeyData.Key.UnicodeChar = L'.'; break;
>+    }
>    case XK_Delete:       KeyData.Key.ScanCode = SCAN_DELETE; break;
>
>    case XK_KP_Insert:
>+    if((Drv->KeyState.KeyShiftState & (EFI_LEFT_SHIFT_PRESSED |
>EFI_RIGHT_SHIFT_PRESSED)) ^ (Drv->KeyState.KeyToggleState &
>(EFI_NUM_LOCK_ACTIVE)) ){
>+      KeyData.Key.UnicodeChar = L'0';break;
>+    }
>    case XK_Insert:     KeyData.Key.ScanCode = SCAN_INSERT; break;
>
>    case XK_KP_Page_Up:
>+    if((Drv->KeyState.KeyShiftState & (EFI_LEFT_SHIFT_PRESSED |
>EFI_RIGHT_SHIFT_PRESSED)) ^ (Drv->KeyState.KeyToggleState &
>(EFI_NUM_LOCK_ACTIVE)) ){
>+      KeyData.Key.UnicodeChar = L'9'; break;
>+    }
>    case XK_Page_Up:    KeyData.Key.ScanCode = SCAN_PAGE_UP; break;
>
>    case XK_KP_Page_Down:
>+    if((Drv->KeyState.KeyShiftState & (EFI_LEFT_SHIFT_PRESSED |
>EFI_RIGHT_SHIFT_PRESSED)) ^ (Drv->KeyState.KeyToggleState &
>(EFI_NUM_LOCK_ACTIVE)) ){
>+      KeyData.Key.UnicodeChar = L'3'; break;
>+    }
>    case XK_Page_Down:  KeyData.Key.ScanCode = SCAN_PAGE_DOWN; break;
>
>+  case XK_KP_Begin:
>+    if((Drv->KeyState.KeyShiftState & (EFI_LEFT_SHIFT_PRESSED |
>EFI_RIGHT_SHIFT_PRESSED)) ^ (Drv->KeyState.KeyToggleState &
>(EFI_NUM_LOCK_ACTIVE)) ){
>+      KeyData.Key.UnicodeChar = L'5'; break;
>+    }
>+    /* no map efi scan code */ break;
>    case XK_Escape:     KeyData.Key.ScanCode = SCAN_ESC; break;
>
>    case XK_Pause:      KeyData.Key.ScanCode = SCAN_PAUSE; break;
>@@ -431,16 +473,6 @@ handleKeyEvent (
>    case XK_KP_Decimal    : KeyData.Key.UnicodeChar = L'.'; break;
>    case XK_KP_Divide     : KeyData.Key.UnicodeChar = L'/'; break;
>
>-  case XK_KP_0    : KeyData.Key.UnicodeChar = L'0'; break;
>-  case XK_KP_1    : KeyData.Key.UnicodeChar = L'1'; break;
>-  case XK_KP_2    : KeyData.Key.UnicodeChar = L'2'; break;
>-  case XK_KP_3    : KeyData.Key.UnicodeChar = L'3'; break;
>-  case XK_KP_4    : KeyData.Key.UnicodeChar = L'4'; break;
>-  case XK_KP_5    : KeyData.Key.UnicodeChar = L'5'; break;
>-  case XK_KP_6    : KeyData.Key.UnicodeChar = L'6'; break;
>-  case XK_KP_7    : KeyData.Key.UnicodeChar = L'7'; break;
>-  case XK_KP_8    : KeyData.Key.UnicodeChar = L'8'; break;
>-  case XK_KP_9    : KeyData.Key.UnicodeChar = L'9'; break;
>
>    default:
>      ;
>--
>2.17.1
>
>_______________________________________________
>edk2-devel mailing list
>edk2-devel@lists.01.org
>https://lists.01.org/mailman/listinfo/edk2-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* 答复: EmulatorPkg/Unix/Host fixed numeric pad function
  2018-11-19  0:52 ` Gao, Liming
@ 2018-11-19  6:11   ` Liu Yu
  0 siblings, 0 replies; 3+ messages in thread
From: Liu Yu @ 2018-11-19  6:11 UTC (permalink / raw)
  To: Gao, Liming,
	"afish@apple.com; jordan.l.justen@intel.com ; ruiyu.ni"@intel.com
  Cc: edk2-devel@lists.01.org

Liming,



  Ok, because the origin code in Unix Host numeric pad has no function in shell environment .

I have tested the X11 ABI on my hand (Ubuntu 18.04), no matter “numlock” is activated or not ,we can’t get “XK_KP_0 ~ XK_KP_9” from  XGetKeyboardMapping  We just can get “numLock” key status.









发送自 Windows 10 版邮件<https://go.microsoft.com/fwlink/?LinkId=550986>应用



________________________________
发件人: Gao, Liming <liming.gao@intel.com>
发送时间: Monday, November 19, 2018 8:52:10 AM
收件人: Liu Yu; "afish@apple.com; jordan.l.justen@intel.com ; ruiyu.ni"@intel.com
抄送: edk2-devel@lists.01.org
主题: RE: [edk2] EmulatorPkg/Unix/Host fixed numeric pad function

Yu:
  Could you add the reason why make this change?

  Besides, please add Contributed-under: TianoCore Contribution Agreement 1.1 before Signed-off-by. And, add Cc: to the package maintainers. Then, use git send-email to send this patch.

Thanks
Liming
>-----Original Message-----
>From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Liu
>Yu
>Sent: Sunday, November 18, 2018 10:54 PM
>To: "afish@apple.com; jordan.l.justen@intel.com ; ruiyu.ni"@intel.com
>Cc: edk2-devel@lists.01.org
>Subject: [edk2] EmulatorPkg/Unix/Host fixed numeric pad function
>
>add numeric pad key map
>
>Signed-off-by: Pedroa Liu <pedroa.liu@outlook.com>
>---
>  EmulatorPkg/Unix/Host/X11GraphicsWindow.c | 54 ++++++++++++++++++-
>----
>  1 file changed, 43 insertions(+), 11 deletions(-)
>
>diff --git a/EmulatorPkg/Unix/Host/X11GraphicsWindow.c
>b/EmulatorPkg/Unix/Host/X11GraphicsWindow.c
>index a3cc28c223..573f0f1bfd 100644
>--- a/EmulatorPkg/Unix/Host/X11GraphicsWindow.c
>+++ b/EmulatorPkg/Unix/Host/X11GraphicsWindow.c
>@@ -271,7 +271,14 @@ handleKeyEvent (
>      }
>    }
>
>-  // Skipping EFI_MENU_KEY_PRESSED and EFI_SYS_REQ_PRESSED
>+  if ((ev->xkey.state & Mod2Mask) == 0) {
>+    Drv->KeyState.KeyToggleState &= ~EFI_NUM_LOCK_ACTIVE;
>+  } else {
>+    if (Make) {
>+      Drv->KeyState.KeyToggleState |= EFI_NUM_LOCK_ACTIVE;
>+    }
>+  }
>+ // Skipping EFI_MENU_KEY_PRESSED and EFI_SYS_REQ_PRESSED
>
>    switch (*KeySym) {
>    case XK_Control_R:
>@@ -328,35 +335,70 @@ handleKeyEvent (
>      break;
>
>    case XK_KP_Home:
>+    if ((Drv->KeyState.KeyShiftState & (EFI_LEFT_SHIFT_PRESSED |
>EFI_RIGHT_SHIFT_PRESSED)) ^ (Drv->KeyState.KeyToggleState &
>(EFI_NUM_LOCK_ACTIVE))) {
>+      KeyData.Key.UnicodeChar = L'7'; break;
>+    }
>    case XK_Home:       KeyData.Key.ScanCode = SCAN_HOME; break;
>
>    case XK_KP_End:
>+    if ((Drv->KeyState.KeyShiftState & (EFI_LEFT_SHIFT_PRESSED |
>EFI_RIGHT_SHIFT_PRESSED)) ^ (Drv->KeyState.KeyToggleState &
>(EFI_NUM_LOCK_ACTIVE))) {
>+      KeyData.Key.UnicodeChar = L'1'; break;
>+    }
>    case XK_End:        KeyData.Key.ScanCode = SCAN_END; break;
>
>    case XK_KP_Left:
>+    if ((Drv->KeyState.KeyShiftState & (EFI_LEFT_SHIFT_PRESSED |
>EFI_RIGHT_SHIFT_PRESSED)) ^ (Drv->KeyState.KeyToggleState &
>(EFI_NUM_LOCK_ACTIVE))) {
>+      KeyData.Key.UnicodeChar = L'4'; break;
>+    }
>    case XK_Left:       KeyData.Key.ScanCode = SCAN_LEFT; break;
>
>    case XK_KP_Right:
>+    if((Drv->KeyState.KeyShiftState & (EFI_LEFT_SHIFT_PRESSED |
>EFI_RIGHT_SHIFT_PRESSED)) ^ (Drv->KeyState.KeyToggleState &
>(EFI_NUM_LOCK_ACTIVE)) ){
>+      KeyData.Key.UnicodeChar = L'6'; break;
>+    }
>    case XK_Right:      KeyData.Key.ScanCode = SCAN_RIGHT; break;
>
>    case XK_KP_Up:
>+    if((Drv->KeyState.KeyShiftState & (EFI_LEFT_SHIFT_PRESSED |
>EFI_RIGHT_SHIFT_PRESSED)) ^ (Drv->KeyState.KeyToggleState &
>(EFI_NUM_LOCK_ACTIVE)) ){
>+      KeyData.Key.UnicodeChar = L'8'; break;
>+    }
>    case XK_Up:         KeyData.Key.ScanCode = SCAN_UP; break;
>
>    case XK_KP_Down:
>+    if((Drv->KeyState.KeyShiftState & (EFI_LEFT_SHIFT_PRESSED |
>EFI_RIGHT_SHIFT_PRESSED)) ^ (Drv->KeyState.KeyToggleState &
>(EFI_NUM_LOCK_ACTIVE)) ){
>+      KeyData.Key.UnicodeChar = L'2'; break;
>+    }
>    case XK_Down:       KeyData.Key.ScanCode = SCAN_DOWN; break;
>
>    case XK_KP_Delete:
>+    if((Drv->KeyState.KeyShiftState & (EFI_LEFT_SHIFT_PRESSED |
>EFI_RIGHT_SHIFT_PRESSED)) ^ (Drv->KeyState.KeyToggleState &
>(EFI_NUM_LOCK_ACTIVE)) ){
>+      KeyData.Key.UnicodeChar = L'.'; break;
>+    }
>    case XK_Delete:       KeyData.Key.ScanCode = SCAN_DELETE; break;
>
>    case XK_KP_Insert:
>+    if((Drv->KeyState.KeyShiftState & (EFI_LEFT_SHIFT_PRESSED |
>EFI_RIGHT_SHIFT_PRESSED)) ^ (Drv->KeyState.KeyToggleState &
>(EFI_NUM_LOCK_ACTIVE)) ){
>+      KeyData.Key.UnicodeChar = L'0';break;
>+    }
>    case XK_Insert:     KeyData.Key.ScanCode = SCAN_INSERT; break;
>
>    case XK_KP_Page_Up:
>+    if((Drv->KeyState.KeyShiftState & (EFI_LEFT_SHIFT_PRESSED |
>EFI_RIGHT_SHIFT_PRESSED)) ^ (Drv->KeyState.KeyToggleState &
>(EFI_NUM_LOCK_ACTIVE)) ){
>+      KeyData.Key.UnicodeChar = L'9'; break;
>+    }
>    case XK_Page_Up:    KeyData.Key.ScanCode = SCAN_PAGE_UP; break;
>
>    case XK_KP_Page_Down:
>+    if((Drv->KeyState.KeyShiftState & (EFI_LEFT_SHIFT_PRESSED |
>EFI_RIGHT_SHIFT_PRESSED)) ^ (Drv->KeyState.KeyToggleState &
>(EFI_NUM_LOCK_ACTIVE)) ){
>+      KeyData.Key.UnicodeChar = L'3'; break;
>+    }
>    case XK_Page_Down:  KeyData.Key.ScanCode = SCAN_PAGE_DOWN; break;
>
>+  case XK_KP_Begin:
>+    if((Drv->KeyState.KeyShiftState & (EFI_LEFT_SHIFT_PRESSED |
>EFI_RIGHT_SHIFT_PRESSED)) ^ (Drv->KeyState.KeyToggleState &
>(EFI_NUM_LOCK_ACTIVE)) ){
>+      KeyData.Key.UnicodeChar = L'5'; break;
>+    }
>+    /* no map efi scan code */ break;
>    case XK_Escape:     KeyData.Key.ScanCode = SCAN_ESC; break;
>
>    case XK_Pause:      KeyData.Key.ScanCode = SCAN_PAUSE; break;
>@@ -431,16 +473,6 @@ handleKeyEvent (
>    case XK_KP_Decimal    : KeyData.Key.UnicodeChar = L'.'; break;
>    case XK_KP_Divide     : KeyData.Key.UnicodeChar = L'/'; break;
>
>-  case XK_KP_0    : KeyData.Key.UnicodeChar = L'0'; break;
>-  case XK_KP_1    : KeyData.Key.UnicodeChar = L'1'; break;
>-  case XK_KP_2    : KeyData.Key.UnicodeChar = L'2'; break;
>-  case XK_KP_3    : KeyData.Key.UnicodeChar = L'3'; break;
>-  case XK_KP_4    : KeyData.Key.UnicodeChar = L'4'; break;
>-  case XK_KP_5    : KeyData.Key.UnicodeChar = L'5'; break;
>-  case XK_KP_6    : KeyData.Key.UnicodeChar = L'6'; break;
>-  case XK_KP_7    : KeyData.Key.UnicodeChar = L'7'; break;
>-  case XK_KP_8    : KeyData.Key.UnicodeChar = L'8'; break;
>-  case XK_KP_9    : KeyData.Key.UnicodeChar = L'9'; break;
>
>    default:
>      ;
>--
>2.17.1
>
>_______________________________________________
>edk2-devel mailing list
>edk2-devel@lists.01.org
>https://lists.01.org/mailman/listinfo/edk2-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-11-19  6:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-18 14:53 EmulatorPkg/Unix/Host fixed numeric pad function Liu Yu
2018-11-19  0:52 ` Gao, Liming
2018-11-19  6:11   ` 答复: " Liu Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox