[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MiNT] 2 keyboard-related issues in trunk
On 09/27/2010 06:40 PM, Jo Even Skarstein wrote:
> It's somehow related to this file. Without it, the + acts normal. Also,
> if I load it in KeyEdit and then apply the layout, the + is still
> normal. However, if I load your file directly the error occurs. I will
> look further into this later tonight.
The keyboard.tbl is perfectly legal. There was a bug in keyboard.c, and
the one responsible for that bug was me. The bug manifests itself if the
deadkeys table is completely missing and an Alt+Caps-table exists. I've
attached a fix.
Description: Fixed a bug where the keyboard table was not correctly
copied if the deadkeys table was missing.
Jo Even
--- freemint.helmut/sys/keyboard.c Mon May 24 20:17:52 2010
+++ freemint/sys/keyboard.c Mon Sep 27 22:17:52 2010
@@ -1603,7 +1603,7 @@
return ENOMEM;
}
- mint_bzero(kbuf, size+1);
+ mint_bzero(kbuf, size+2);
if ((*fp->dev->read)(fp, (char *)kbuf, size) == size)
{
@@ -1611,7 +1611,7 @@
{
case 0x2771: /* magic word for std format */
{
- quickmove(kbuf, kbuf + sizeof(short), size - sizeof(short) + 1);
+ quickmove(kbuf, kbuf + sizeof(short), size - sizeof(short) + 2);
break;
}
case 0x2772: /* magic word for ext format */
@@ -1627,7 +1627,7 @@
if ((sbuf[1] >= 0) && (sbuf[1] <= MAXAKP))
gl_kbd = sbuf[1];
- quickmove(kbuf, kbuf + sizeof(long), size - sizeof(long) + 1);
+ quickmove(kbuf, kbuf + sizeof(long), size - sizeof(long) + 2);
break;
}
case 0x2773: /* the ISO format (as of 30.VII.2004) */
@@ -1646,7 +1646,7 @@
{
iso_8859_code = (long)sbuf[3];
quickmove(kbuf, kbuf + (sizeof(long)*2), \
- size - (sizeof(long)*2) + 1);
+ size - (sizeof(long)*2) + 2);
}
else
{