Reputation: 1571
I am trying to catch the enter/return key in a GtkEntry
widget. Should I make a signal hander for key-press-event
or key-release event
?
Upvotes: 0
Views: 2121
Reputation: 1460
Alternatively you could look at connecting to the "activate" signal which gets fired when the user hits enter or activates it through some other method.
Upvotes: 4
Reputation: 5683
It depends when you want to act on the event as either signal will do. If you handle key-press-event and the user holds down the key, then you'll keep getting signals. If you handle key-release-event then you'll only get one signal when the user releases the key.
I think most commonly you'll want to use key-release-event.
Upvotes: 3