Fix to Tom Briden's recent touch-screen commit; the original commit
authorsrs5694 <srs5694@users.sourceforge.net>
Thu, 9 Feb 2017 19:24:26 +0000 (14:24 -0500)
committersrs5694 <srs5694@users.sourceforge.net>
Thu, 9 Feb 2017 19:24:26 +0000 (14:24 -0500)
did not compile cleanly for IA32, at least not with the TianoCore
toolkit.

NEWS.txt
refind/menu.c

index 6a890f3..58c4f47 100644 (file)
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -1,6 +1,10 @@
-0.10.5 (??/??/201?):
+0.10.5 (??/??/2017):
 --------------------
 
+- Add new key mappings: Backspace (Delete on Mac keyboards) works the same
+  as Esc, and Tab works the same as F2/Insert/+. This is done for the
+  benefit of new Apple laptops that lack physical Esc and function keys.
+
 - Fix to refind-install to work better with disks other than /dev/sd? and
   /dev/hd? devices.
 
index 08abe3e..fe4cf7d 100644 (file)
@@ -394,9 +394,11 @@ static UINTN RunGenericMenu(IN REFIT_MENU_SCREEN *Screen, IN MENU_STYLE_FUNC Sty
     CHAR16 TimeoutMessage[256];
     CHAR16 KeyAsString[2];
     UINTN MenuExit;
-       
-       EFI_STATUS TouchStatus = EFI_NOT_READY;
-       EFI_ABSOLUTE_POINTER_STATE TouchState;
+    EFI_STATUS TouchStatus = EFI_NOT_READY;
+    EFI_ABSOLUTE_POINTER_STATE TouchState;
+    UINT32 TouchScreenPosX;
+    UINT32 TouchScreenPosY;
+    UINTN Item;
 
     if (Screen->TimeoutSeconds > 0) {
         HaveTimeout = TRUE;
@@ -619,11 +621,9 @@ static UINTN RunGenericMenu(IN REFIT_MENU_SCREEN *Screen, IN MENU_STYLE_FUNC Sty
             }
         } else { //react to touch event
             //the TouchProtocol min/max may not match the screen size
-            UINT32 TouchScreenPosX = (TouchState.CurrentX * UGAWidth) / TouchProtocol->Mode->AbsoluteMaxX;
-            UINT32 TouchScreenPosY = (TouchState.CurrentY * UGAHeight) / TouchProtocol->Mode->AbsoluteMaxY;
-
-
-            UINTN Item = FindMainMenuItem(Screen, &State, TouchScreenPosX, TouchScreenPosY);
+            TouchScreenPosX = ((UINT32) TouchState.CurrentX * UGAWidth) / (UINT32) TouchProtocol->Mode->AbsoluteMaxX;
+            TouchScreenPosY = ((UINT32) TouchState.CurrentY * UGAHeight) / (UINT32) TouchProtocol->Mode->AbsoluteMaxY;
+            Item = FindMainMenuItem(Screen, &State, TouchScreenPosX, TouchScreenPosY);
             switch (Item) {
                 case TOUCH_NO_ITEM:
                     //do nothing