FXRuby: how to capture a function key? 
Author Message
 FXRuby: how to capture a function key?

i use ruby 1.6.7, fox 1.0.18 , FXRuby 1.0.12.
all compile on cygwin ( on windows xp).

on Tk , i can use widget.bind('key-F1',proc{..}) to capture key
   and execute code

now , i try to use FXRuby instead, but i don't know
how to capture function key and execute code?

somphong s.



Thu, 10 Feb 2005 15:09:29 GMT  
 FXRuby: how to capture a function key?

Quote:

> i use ruby 1.6.7, fox 1.0.18 , FXRuby 1.0.12.
> all compile on cygwin ( on windows xp).

> on Tk , i can use widget.bind('key-F1',proc{..}) to capture key
>    and execute code

> now , i try to use FXRuby instead, but i don't know
> how to capture function key and execute code?

> somphong s.

Try:

        widget.connect(SEL_KEYPRESS) do |sender, sel, event|
          if event.code == KEY_F1
            # do something
          end
        end

Hope this helps,

Lyle



Fri, 11 Feb 2005 23:27:29 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. FXRuby usage: Capturing results from an FXDialogBox

2. FXRuby: how do you capture a canvas resize?

3. Incremental Development Process is Key to Capturing OO Benefits

4. Incremental Development Process is Key to Capturing OO

5. Another key capture question

6. VSE - Capturing Enter Key.

7. capturing key strokes for testing

8. How to capture key events

9. How to capture key-presses (keyboard-presses)???

10. Capturing key presses...

11. python Newbie Question: key-press capturing.

12. Can you capture Key-Release events in Tkinter?

 

 
Powered by phpBB® Forum Software