summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2000-12-08 21:40:02 +0000
committerKeith Packard <keithp@keithp.com>2000-12-08 21:40:02 +0000
commitb59eabd230110d604515868893d9aa06e6d3b748 (patch)
tree435036b59e913b4f04bcb463fc58f97594302598
parenta25637fe789c5127451233c759074780cbc110ac (diff)
kdrive: A few iPAQ inspired changes to event management
-rw-r--r--hw/kdrive/src/kinput.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
index bc93f634e..e0dc7a587 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -21,7 +21,7 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $XFree86: xc/programs/Xserver/hw/kdrive/kinput.c,v 1.9 2000/10/06 22:05:53 keithp Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/kdrive/kinput.c,v 1.10 2000/10/08 02:08:39 keithp Exp $ */
#include "kdrive.h"
#include "inputstr.h"
@@ -1069,16 +1069,16 @@ KdReleaseAllKeys (void)
xEvent xE;
int key;
+ KdBlockSigio ();
for (key = 0; key < KD_KEY_COUNT; key++)
if (IsKeyDown(key))
{
xE.u.keyButtonPointer.time = GetTimeInMillis();
xE.u.u.type = KeyRelease;
xE.u.u.detail = key;
- KdBlockSigio ();
KdHandleKeyboardEvent (&xE);
- KdUnblockSigio ();
}
+ KdUnblockSigio ();
}
void
@@ -1155,15 +1155,20 @@ KdEnqueueKeyboardEvent(unsigned char scan_code,
{
return;
}
+ /*
+ * X delivers press/release even for autorepeat
+ */
+ xE.u.u.type = KeyRelease;
+ KdHandleKeyboardEvent (&xE);
+ xE.u.u.type = KeyPress;
}
-#if 0
- if (xE.u.u.type == KeyRelease && !IsKeyDown (key_code))
+ /*
+ * Check released keys which are already up
+ */
+ else if (!IsKeyDown (key_code) && xE.u.u.type == KeyRelease)
{
- xE.u.u.type = KeyPress;
- KdHandleKeyboardEvent (&xE);
- xE.u.u.type = KeyRelease;
+ return;
}
-#endif
KdCheckSpecialKeys (&xE);
KdHandleKeyboardEvent (&xE);
}