Merge lp:~gero-bare/midori/midori-bug-1300451 into lp:midori

Proposed by Gero.Bare
Status: Work in progress
Proposed branch: lp:~gero-bare/midori/midori-bug-1300451
Merge into: lp:midori
Diff against target: 37 lines (+27/-0)
1 file modified
midori/midori-browser.c (+27/-0)
To merge this branch: bzr merge lp:~gero-bare/midori/midori-bug-1300451
Reviewer Review Type Date Requested Status
Gero.Bare (community) Needs Fixing
Cris Dywan Approve
Review via email: mp+242618@code.launchpad.net

Description of the change

This is a initial support for media keys in midori.

Things to notice: First you'll see that I grouped the events of the media keys together, instead of grouping them by the action they perform (with the other keys related).

This is because I though it would be nice to be able to enable/disable with an option in midori, but because I don't know how to do that it ended this way.

To post a comment you must log in.
Revision history for this message
Cris Dywan (kalikiana) wrote :

Note: I can't really test these. Ideally if we at one point in the future have UI test coverage this should be included.

In general this seems fine. Ideally it wouldn't be manually hacked into the key handling, alas we still don't have a way to assign several keys to the same UI action. So, I won't object to doing it this way.

review: Approve
Revision history for this message
Gero.Bare (gero-bare) wrote :

You are right.
But we have a way. I think I should merge this into our shortcut plugin.
A simple "use media key" check button to turn on, off. Generally the people don't play with media keys so we should be fine.

review: Needs Fixing

Unmerged revisions

6844. By Gero.Bare

Deleted a duplicated condition.

6843. By Gero.Bare

Add Media Keys support.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'midori/midori-browser.c'
2--- midori/midori-browser.c 2014-11-22 17:20:43 +0000
3+++ midori/midori-browser.c 2014-11-24 04:16:36 +0000
4@@ -2141,6 +2141,33 @@
5 return TRUE;
6 }
7
8+ /*Implementing Media keys*/
9+ if (event->keyval == GDK_KEY_HomePage)
10+ {
11+ midori_browser_activate_action (browser, "Homepage");
12+ return TRUE;
13+ }
14+ else if (event->keyval == GDK_KEY_Search){
15+ midori_browser_activate_action (browser, "Search");
16+ return TRUE;
17+ }
18+ else if (event->keyval == GDK_KEY_Stop){
19+ midori_browser_activate_action (browser, "Stop");
20+ return TRUE;
21+ }
22+ else if (event->keyval == GDK_KEY_Refresh){
23+ midori_browser_activate_action (browser, "Reload");
24+ return TRUE;
25+ }
26+ else if (event->keyval == GDK_KEY_Back){
27+ midori_browser_activate_action (browser, "Back");
28+ return TRUE;
29+ }
30+ else if (event->keyval == GDK_KEY_Forward){
31+ midori_browser_activate_action (browser, "Forward");
32+ return TRUE;
33+ }
34+
35 widget_class = g_type_class_peek_static (g_type_parent (GTK_TYPE_WINDOW));
36 return widget_class->key_press_event (widget, event);
37 }

Subscribers

People subscribed via source and target branches

to all changes: