Bug 59195

Summary: xgalaga no keyboard control under kde
Product: Ports & Packages Reporter: Lee Harr <lee>
Component: Individual Port(s)Assignee: Pav Lucistnik <pav>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Lee Harr 2003-11-11 23:50:19 UTC
Running xgalaga when in KDE there is no keyboard control
(and also no way to get mouse control to work, since the
keyboard does not work).

Works fine under twm.

Fix: The key values are being passed back in to xgalaga 256 higher
than it expects. This patch corrects the problem, so that the
game runs correctly under both kde and twm:



if(gameOver)
              mouseControl = 1;
@@ -826,6 +827,7 @@

     while(W_EventsPending()) {
         W_NextEvent(&wev);
+        if (wev.key >= 256) wev.key -= 256;

         switch(wev.type) {
         case W_EV_KEY_OFF:--A7mswXqT2SJ1Nmo7RggMAqk4TBGf0SCqoFjsfawZEzF28VHZ
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

--- main.c.orig Mon May 11 02:52:59 1998
+++ main.c      Mon Nov 10 23:10:55 2003
@@ -779,6 +779,7 @@
     if(gameOver) {
         while(W_EventsPending()) {
             W_NextEvent(&wev);
+            if (wev.key >= 256) wev.key -= 256;
How-To-Repeat: Log in to KDE, run xgalaga. Space bar should fire, but it does not.
Comment 1 Pav Lucistnik freebsd_committer freebsd_triage 2003-11-15 18:37:21 UTC
Responsible Changed
From-To: freebsd-ports-bugs->pav

I'll take this one.
Comment 2 Pav Lucistnik freebsd_committer freebsd_triage 2003-11-16 00:41:57 UTC
State Changed
From-To: open->closed

Committed, thanks. Good catch!