Sha256: 89ff7da79c6679aaa4f413d5c9c0a1b8e9144dad405cdc1a339634db615c43c3

Contents?: true

Size: 788 Bytes

Versions: 38

Compression:

Stored size: 788 Bytes

Contents

=begin
  keyboard_grab.rb - Gdk::Window#keyboard_grab/ungrab sample script.

  Copyright (C) 2001-2006 Masao Mutoh
  This program is licenced under the same licence as Ruby-GNOME.

  $Date: 2006/06/17 13:18:12 $
  $Id: keyboard_grab.rb,v 1.5 2006/06/17 13:18:12 mutoh Exp $
=end

require 'gtk3'

window = Gtk::Window.new("Keyboard Grab/Ungrab sample")

button1 = Gtk::Button.new("Grab Keyboard!")
button2 = Gtk::Button.new("Ungrab Keyboard!")

button1.signal_connect('clicked') do
  Gdk.keyboard_grab(window.window, true, Gdk::Event::CURRENT_TIME)
end

button2.signal_connect('clicked') do
  Gdk.keyboard_ungrab(Gdk::Event::CURRENT_TIME)
end

window.add(Gtk::VBox.new.add(button1).add(button2))
window.set_default_size(200,100).show_all.signal_connect("destroy"){Gtk.main_quit}

Gtk.main

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
gtk3-2.2.5-x64-mingw32 sample/misc/keyboard_grab.rb
gtk3-2.2.5-x86-mingw32 sample/misc/keyboard_grab.rb
gtk3-2.2.5 sample/misc/keyboard_grab.rb
gtk3-2.2.4-x64-mingw32 sample/misc/keyboard_grab.rb
gtk3-2.2.4-x86-mingw32 sample/misc/keyboard_grab.rb
gtk3-2.2.4 sample/misc/keyboard_grab.rb
gtk3-2.2.3-x86-mingw32 sample/misc/keyboard_grab.rb
gtk3-2.2.3 sample/misc/keyboard_grab.rb
gtk3-2.2.2-x86-mingw32 sample/misc/keyboard_grab.rb
gtk3-2.2.2 sample/misc/keyboard_grab.rb
gtk3-2.2.1-x86-mingw32 sample/misc/keyboard_grab.rb
gtk3-2.2.1 sample/misc/keyboard_grab.rb
gtk3-2.2.0-x86-mingw32 sample/misc/keyboard_grab.rb
gtk3-2.2.0 sample/misc/keyboard_grab.rb
gtk3-2.1.0-x86-mingw32 sample/misc/keyboard_grab.rb
gtk3-2.1.0 sample/misc/keyboard_grab.rb
gtk3-2.0.3-x86-mingw32 sample/misc/keyboard_grab.rb
gtk3-2.0.3 sample/misc/keyboard_grab.rb
gtk3-2.0.2-x86-mingw32 sample/misc/keyboard_grab.rb
gtk3-2.0.2 sample/misc/keyboard_grab.rb