Hello Terry,

I tested Tom's recommendation and yes the ALT-Break not working
problem is solved for the recompiler. I also tested  TechWriter and I
didn't got repeating key problems very easily when entering random
text. So I think this is a improvement. A patch is applied to this
mail, it also enables the Pause/Break-key so you can use ALT-Break
too. If I don't hear any problems from anybody in the next week, I'll
add this patch to the depository.

Greetings,
Dick.
Index: src/iomd.c
===================================================================
--- src/iomd.c	(revision 139)
+++ src/iomd.c	(working copy)
@@ -47,6 +47,7 @@
         if (clockcmos==5)
         {
                 cmostick();
+                pollkeyboard();
                 clockcmos=0;
         }
 //        rpclog("IRQ %i\n",inscount);
Index: src/keyboard.c
===================================================================
--- src/keyboard.c	(revision 139)
+++ src/keyboard.c	(working copy)
@@ -29,10 +29,11 @@
 int mousehackon = 1;
 int kbdenable=0,kbdreset;
 unsigned char kbdstat;
-unsigned char kbdpacket[3]={0,0,0};
+unsigned char kbdpacket[5]={0,0,0,0,0};
 int kbdpacketsize=0,kbdpacketpos=0;
 unsigned char kbdcommand;
 int keys2[128];
+int release_pausekey=0;
 
 int msenable=0,msreset;
 unsigned char msstat,mscommand;
@@ -63,6 +64,7 @@
         mcallback=0;
         msreset=0;
         msstat=0;
+        release_pausekey=0;
         for (c=0;c<128;c++)
             keys2[c]=0;
 }
@@ -496,6 +498,24 @@
 {
         int c;
         int temp;
+
+        if (release_pausekey)
+        { 
+        	// Force Pause key to release it's state for ARM
+                printf("Pause key released for ARM\n");
+                kbdpacket[0]=0xE1;
+                kbdpacket[1]=0xF0;
+                kbdpacket[2]=0x14;
+                kbdpacket[3]=0xF0;
+                kbdpacket[4]=0x77;
+                kbdpacketsize=5;
+                kbdpacketpos=0;
+                kcallback=20;
+                kbdcommand=0xFE;
+                release_pausekey=0;
+                return;
+        }
+
         for (c=0;c<128;c++)
         {
 //				if (c==KEY_X) c++;
@@ -509,12 +529,14 @@
                         {
                                 if (!keys2[c])
                                 {
+                                        // when key released
                                         kbdpacket[0]=0xF0;
                                         kbdpacket[1]=temp;
                                         kbdpacketsize=2;
                                 }
                                 else
                                 {
+                                        // when key pressed
                                         kbdpacket[0]=temp;
                                         kbdpacketsize=1;
                                 }
@@ -532,6 +554,7 @@
                                 {
                                         if (!keys2[c])
                                         {
+                                                // when key released
                                                 kbdpacket[0]=kbdtemp;
                                                 kbdpacket[1]=0xF0;
                                                 kbdpacket[2]=temp;
@@ -539,6 +562,7 @@
                                         }
                                         else
                                         {
+                                                // when key pressed
                                                 kbdpacket[0]=kbdtemp;
                                                 kbdpacket[1]=temp;
                                                 kbdpacketsize=2;
@@ -549,6 +573,27 @@
 //                                        rpclog("Sending packet %02X %02X %02X %i\n",kbdpacket[0],kbdpacket[1],kbdpacket[2],kbdpacketsize);
                                         return;
                                 }
+				else
+                                {
+                                        if (c==KEY_PAUSE)
+                                        {
+                                                printf("Found Pause/Break key %i\n",c);
+                                                printf("Force key on for ARM\n");
+						// Force Pause key for ARM alway on even if allegro sets it's state off
+                                                kbdpacket[0]=0xE1;
+                                                kbdpacket[1]=0x14;
+                                                kbdpacket[2]=0x77;
+                                                kbdpacketsize=3;
+                                                release_pausekey=-1; //Set release state so that on the next poll de key will be released
+
+                                                kbdpacketpos=0;
+                                                kcallback=20;
+                                                kbdcommand=0xFE;
+//                                                rpclog("Sending packet %02X %02X %02X %i\n",kbdpacket[0],kbdpacket[1],kbdpacket[2],kbdpacket[3],kbdpacketsize);
+                                        return;                                              		
+                                        }                                        
+                                        
+                                }
                         }
                 }
         }
Index: src/rpcemu.c
===================================================================
--- src/rpcemu.c	(revision 139)
+++ src/rpcemu.c	(working copy)
@@ -130,7 +130,7 @@
 //                pollmouse();
 //                sleep(0);
 //                doosmouse();
-                pollkeyboard();
+//                pollkeyboard();
 }
 
 void endrpcemu()
_______________________________________________
Rpcemu mailing list
[email protected]
http://www.riscos.info/cgi-bin/mailman/listinfo/rpcemu

Reply via email to