M
Martin Ankerl
I would like to grab all keyboard events, I especially need the left,
right, up, down keys. At the moment I have this code:
@input = FXText.new(@parent)
@input.connect(SEL_KEYPRESS) do |sender, sel, data|
# now what? data.code seems to contain a keycode
p data.code
end
There the focus has to be on the textbox, which records each keypress.
data.code seems to contain some kind of keycode, but I could not
figure out if somewhere constants are defined for the keys (like,
FX_KEY_DOWN or something like this). Any ideas how to use this
properly?
Martin
right, up, down keys. At the moment I have this code:
@input = FXText.new(@parent)
@input.connect(SEL_KEYPRESS) do |sender, sel, data|
# now what? data.code seems to contain a keycode
p data.code
end
There the focus has to be on the textbox, which records each keypress.
data.code seems to contain some kind of keycode, but I could not
figure out if somewhere constants are defined for the keys (like,
FX_KEY_DOWN or something like this). Any ideas how to use this
properly?
Martin