4

def activate(self,shell):
  self.shell = shell
  self.copy_selected()
  self.action = gtk.Action ('foo','bar','baz',None)
  self.activate_id = self.action.connect ('activate', self.call_bk_fn,self.shell)
  self.action_group = gtk.ActionGroup ('hot_key_action_group')
  self.action_group.add_action_with_accel (self.action, "<control>E")

  uim = shell.get_ui_manager ()
  uim.insert_action_group (self.action_group, 0)
  uim.ensure_update ()
def call_bk_fn():
                print('hello world')

I am using the above code in a plugin for Rhythmbox and here I am trying to register the key Ctrl+E so that the call_bk_fn gets called whenever the key combination is pressed but its not working.

Why is that so ?

1

1 Answer 1

0

I have no Knowledge about the plugin your using.

However Ubuntu has another solution for this:-)

Go to: System>Preferences>Keyboard Shortcuts

right at the top under "sound" you can set action keys including a next track, play, pause, volume down, etc.

1
  • i figured that out , made a plugin for it .. you can download it as well . who knows may be you might like it . Mar 4, 2012 at 13:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .