[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] Ctrl+Alt+Q deactivated



On 09/21/2010 06:05 PM, Helmut Karlowski wrote:

>> Out of curiosity I tried my version yesterday - the alert is displayed, but the
>> return-value (intout[0]) is not 0 or 1 but 8 or 9, so it would work when
>> subsctracting 7. Also I gave the AESPB-members memory.
>>
>> But C.Aes does not terminate ..
>>
>> Maybe this would work from k_keybd.
> 
> It works from taskman now!

Cool :) So you handle the alert from within dispatch_shutdown()? You
might want to apply this patch to k_keybd then:

If $SDMASTER is set to point to an executable file, this program is
launched when Ctrl+Alt+Q is pressed. If $SDMASTER isn't defined,
shutdown is done immediately.

Jo Even
--- freemint.ref/xaaes/src.km/k_keybd.c	Wed Jun  2 21:38:18 2010
+++ freemint/xaaes/src.km/k_keybd.c	Mon Sep 20 22:20:54 2010
@@ -564,8 +564,20 @@
 #if HOTKEYQUIT
 		case 'Q':
 		{
-			DIAGS(("shutdown by CtlAlt Q"));
-			dispatch_shutdown(0, 0);
+			struct proc *p;
+			char *sdmaster = get_env(0, "SDMASTER=");
+
+			if (sdmaster)
+			{
+				int ret = create_process(sdmaster, NULL, NULL, &p, 0, NULL);
+				if (ret < 0)
+					ALERT(("$SDMASTER is not a valid program: %s", sdmaster));
+			}
+			else
+			{
+				DIAGS(("shutdown by CtlAlt Q"));
+				dispatch_shutdown(0, 0);
+			}
 			return true;
 		}
 		case 'H':