I want to write an application which will intercept some keyboards sequences (like those in Emacs – "C-c C-c") and run some function.
How can I do this in GNOME?
On wich level I should do that (kernel, X11, window manager)?
I want to write an application which will intercept some keyboards sequences (like those in Emacs – "C-c C-c") and run some function.
How can I do this in GNOME?
On wich level I should do that (kernel, X11, window manager)?
To run a commond on a certain key press you can configure that in metacity or compiz (depending which you're running).
For metacity run gconf-editor
, go to /apps/metacity/keybinding_commands
and under there you will see command_1
etc. In there you set the command to run, and then in /apps/metacity/global_keybindings
you set the keybindings to match. The key for run_command_1
runs the command for command_1
, and so on.
For compiz you want to run ccsm
("compiz config settings manager") and use the Commands plugin to configure it, in more or less the same way.
For performing an action in Gedit, as far as I know there is no way to do that, unless there is an existing keyboard shortcut for the command you are issuing. In that case you may be able to find an app that translates "C-c C-u" into the right shortcut for Gedit. But I've never done it.