Opened 12 years ago

Last modified 12 years ago

#33 new defect

GLUT doesn't return correct KeyPad events under Linux / XMonad

Reported by: Ben Lippmeier Owned by:
Priority: normal Milestone: 1.8.0
Component: Unknown Version: 1.7.0
Keywords: Cc:

Description

Christopher Howard writes:

I've been using gloss in an arcade game I've been writing, and overall everything has been working great. However, it seems as though my program does not receive any events for the key pad (KeyPad0, KeyPad1, etc.) regardless of whether Num Lock is active or not. If Num Lock is off, those keys that have alternate names will receive the appropriate event (KeyInsert, KeyLeft, and so forth), but never the KeyPad events proper.

I am developing on an amd64 Gentoo Linux box, using GHC 7.4 and gloss-1.7.6.5, under the xmonad window manager. I have a Microsoft brand ergonomic keyboard operating in standard QWERTY mode. Key pad functionality seems to work fine in text editors (num-lock and non num-lock modes). In case there might be some problem with my application code, I wrote a shorter program which seems to confirm that no KeyPad* events are being received:

import Graphics.Gloss.Interface.IO.Game

data World = World

main = playIO
         (InWindow "test keypad input" (1024, 768) (0, 0))
         black
         20
         World (\w -> return Blank)
         eHandler
         (\t w -> return w)

eHandler (EventKey (SpecialKey KeyPad0) _ _ _) w
  = undefined

eHandler _ w
  = return w

It should crash when key pad button 0 is pressed, but it does not.

Change History (1)

comment:1 Changed 12 years ago by Ben Lippmeier

This works ok when using the GLFW backend

Note: See TracTickets for help on using tickets.