FXRuby/GLCanvas keypress problems

I’ve run into a little annoying problem using the GLCanvas with
FXRuby/FOX. Basically, i’ve got my GLCanvas:

@glcanvas = FXGLCanvas.new(panel, @glvisual, nil, 0, …)

and i register the keyPress handler thus:

@glcanvas.connect(SEL_KEYPRESS) { |sender, sel, ptr|
handleKeyPress(sender,sel,ptr)
}

… defined as:

def handleKeyPress(sender, sel, ptr)
p “keypressed!: #{sender}, #{sel}, #{ptr}”

case ptr.code # this should be the int value of the char typed

other stuff to handle it

end
end

NOW: basically while ptr should be a Fox::FXEvent object, in certain
not-very-special situations, i get this:

%ruby testgui-gl.rb

“keypressed!: #Fox::FXGLCanvas:0x5..4, 65536, 0.99”

so what should be an FXEvent object is actually a float. it doesn’t
matter which key i press, it always does this, and frankly i’m
stumped. Anyone have any clues?

Thanks

  • James