0
votes

I am using glade along with language C to develop a GUI. I am able to map all the number keys and letter keys from keyboard to glade buttons as accelerators. However, i cannot map the following buttons: ESC, Up, Down, Left, Right arrows.

In glade when i type in the accelerator field up, down, left, right or esc nothing is stored. But if i type them in holding the CTRL it stores them as primary button.

enter image description here

Even in .glade file the keys are stored as they are supposed to be by working alone, but they only function when i hold also the CTRL.

<object class="GtkButton" id="button_left_roll">
  <property name="visible">True</property>
  <property name="can_focus">True</property>
  <property name="receives_default">True</property>
  <property name="image">image19</property>
  <property name="always_show_image">True</property>
  <signal name="clicked" handler="on_button_left_roll_clicked" swapped="no"/>
  <accelerator key="Left" signal="clicked" modifiers="GDK_CONTROL_MASK"/>
</object>

How can i use them without holding down the CTRL key?

1
modifiers="GDK_CONTROL_MASK" says they are not supposed to work without ctrl key pressed. What happens if you just remove this part?Alexander Dmitriev
@AlexanderDmitriev thank you very much, this was the problem, but removing it caused the gui to not show. But i searched for modifiers and found a workarounduser3143155

1 Answers

0
votes

What actually causes the problem is: modifiers="GDK_CONTROL_MASK". So what worked for me is: setting GDK_CONTROL_MASK to GDK_LOCK_MASK.