Patch for global shortcuts on Windows

Casper van Donderen casper.vandonderen at gmail.com
Sat Aug 8 19:06:45 CEST 2009


Well...

There are 2 real options:
-  Change the global shortcuts for Windows in the 3 applications that
have global volume control (I found 3: Dragon, JuK & Amarok) to
Meta+<arrow>.
-  Change the global shortcuts for all platforms in these applications
to Meta+<arrow>, risking a flame war: 'why do we need to change a
shortcut we had for ages now in favor of the ##$#!! platform?'

we don't have any people at Microsoft who are willing to change their
global shortcuts for us, so I feel that this is the best solution now:
the Linux people stay with their shortcuts and the Windows people who
never had the possibility of running KDE now get their shortcuts
mapped to something which is different, but at least works.

Casper

On Sat, Aug 8, 2009 at 6:53 PM, Ian Monroe<ian.monroe at gmail.com> wrote:
> On Sat, Aug 8, 2009 at 7:36 AM, Casper van
> Donderen<casper.vandonderen at gmail.com> wrote:
>> There has been a bug report this week about multimediakeys in
>> KDE/Amarok ( https://bugs.kde.org/show_bug.cgi?id=202747 )
>> Because of this I have been looking into the shortcuts on Windows.
>>
>> it appears that MS locked all combinations with the plus and minus
>> keys to OS functions (even though not used, ctrl+alt+minus is to zoom
>> out using the screen magnifier, I never use that but still I cannot
>> use the combo in Amarok)
>>
>> So for now I made a patch to switch to using Meta+<up/down> for volume changes:
>>
>> diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp
>> index d451cb9..7339ded 100644
>> --- a/src/MainWindow.cpp
>> +++ b/src/MainWindow.cpp
>> @@ -694,13 +694,21 @@ MainWindow::createActions()
>>
>>     action = new KAction( i18n( "Increase Volume" ), this );
>>     ac->addAction( "increaseVolume", action );
>> +    #ifndef Q_WS_WIN
>>     action->setGlobalShortcut( KShortcut( Qt::META + Qt::Key_Plus ) );
>> +    #else Q_WS_WIN
>> +    action->setGlobalShortcut( KShortcut( Qt::META + Qt::Key_Up ) );
>> +    #endif Q_WS_WIN
>>     action->setShortcut( Qt::Key_Plus );
>>     connect( action, SIGNAL( triggered() ), ec, SLOT( increaseVolume() ) );
>>
>>     action = new KAction( i18n( "Decrease Volume" ), this );
>>     ac->addAction( "decreaseVolume", action );
>> +    #ifndef Q_WS_WIN
>>     action->setGlobalShortcut( KShortcut( Qt::META + Qt::Key_Minus ) );
>> +    #else Q_WS_WIN
>> +    action->setGlobalShortcut( KShortcut( Qt::META + Qt::Key_Down ) );
>> +    #endif Q_WS_WIN
>>     action->setShortcut( Qt::Key_Minus );
>>     connect( action, SIGNAL( triggered() ), ec, SLOT( decreaseVolume() ) );
>
> Looks fine to me. Just add some comments to explain why this
> difference is needed. :)
>
> Ian
>


More information about the Amarok-devel mailing list