File: example.lua

package info (click to toggle)
keybinder-3.0 0.3.2-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 232 kB
  • sloc: ansic: 595; makefile: 112; sh: 32; python: 15
file content (20 lines) | stat: -rwxr-xr-x 494 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env lua

-- example.lua
--
-- Created in 2010 by Ulrik Sverdrup <ulrik.sverdrup@gmail.com>
-- This work is placed in the public domain.

require "minigtk"
require "keybinder"

function callback(keystring, user_data)
  print("In callback", keystring, keybinder.get_current_event_time())
  print("Userdata: ", user_data)
  minigtk.main_quit()
end

minigtk.init()
keybinder.bind("<Control>A", callback, {1,2,3})
print("Press <Control>A to activate keybinding and quit");
minigtk.main()