[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: KGlobalAccel sample code?
From: "Steiger, Keith" <Keith.Steiger () fei ! com>
Date: 2007-04-27 23:28:22
Message-ID: 00948E5E66F1374FB9284A7B78138EB809A1A57B () hlexc03 ! w2k ! feico ! com
[Download RAW message or body]
--===============0249214204==
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C78924.4641FD4A"
This is a multi-part message in MIME format.
After doing lots of Googling for a way to give an application hotkeys
that will fire even without keyboard focus, I found people suggesting
that this app or that app have global hotkeys like Amarok. After
grabbing the Amarok source code and looking through it, I discovered
that it uses the KGlobalAccel class to do this. But I don't know what
KDE calls it uses are necessary to get them to work, and which ones
Amarok is using to satisfy other needs.
So then I went looking for a snippet of source code that would give a
minimal example of how to use KGlobalAccel-for example, an application
that creates a window with 1 button, and prints "Hello!" when either
that button is clicked or F11 is pressed. But I can't find any such
source code, and I'm not having great luck trying to construct such a
toy example myself.
Does anyone know where to find such an example? If not, I'll probably
post my amateurish attempt to create one....
Keith.Steiger@fei.com
(who hasn't ever coded in KDE before)
[Attachment #3 (text/html)]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7234.20">
<TITLE>KGlobalAccel sample code?</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 \
FACE="Arial">After doing lots of Googling for a way to</FONT></SPAN><SPAN \
LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT SIZE=2 FACE="Arial">give an \
application</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 \
FACE="Arial"> hotkeys that will fire even without keyboard focus, I found people \
suggesting that this app or that app have global hotkeys like Amarok. After \
grabbing the Amarok source code</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN \
LANG="en-us"> <FONT SIZE=2 FACE="Arial">and</FONT></SPAN><SPAN \
LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial"></FONT></SPAN><SPAN \
LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT SIZE=2 FACE="Arial">looking through it, \
I discovered that it uses the KGlobalAccel class to do this.</FONT></SPAN><SPAN \
LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial"> But I \
don</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 \
FACE="Arial">’</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT \
SIZE=2 FACE="Arial">t know what KDE calls it uses are necessary to get them to work, \
and which ones</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT \
SIZE=2 FACE="Arial">Amarok is using to satisfy other needs.</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">So then I went looking for a \
snippet of source code that would give a minimal example of how to use \
KGlobalAccel</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 \
FACE="Arial">—</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT \
SIZE=2 FACE="Arial">for example, an</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN \
LANG="en-us"> <FONT SIZE=2 FACE="Arial">application</FONT></SPAN><SPAN \
LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial"> that creates a \
window with 1 button, and prints</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN \
LANG="en-us"> <FONT SIZE=2 FACE="Arial">“</FONT></SPAN><SPAN \
LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 \
FACE="Arial">Hello!</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT \
SIZE=2 FACE="Arial">”</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN \
LANG="en-us"><FONT SIZE=2 FACE="Arial"> when either that button is</FONT></SPAN><SPAN \
LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT SIZE=2 \
FACE="Arial">clicked</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT \
SIZE=2 FACE="Arial"> or F11</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN \
LANG="en-us"> <FONT SIZE=2 FACE="Arial">is pressed. But I \
can</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 \
FACE="Arial">’</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT \
SIZE=2 FACE="Arial">t find any such source code, and I</FONT></SPAN><SPAN \
LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 \
FACE="Arial">’</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT \
SIZE=2 FACE="Arial">m not having great luck trying to construct such a toy example \
myself.</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 \
FACE="Arial">Does anyone know where to find such an example? If not, \
I</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 \
FACE="Arial">’</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT \
SIZE=2 FACE="Arial">ll probably post my amateurish attempt to create \
one</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 \
FACE="Arial">…</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT \
SIZE=2 FACE="Arial">.</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 \
FACE="Arial"> </FONT></SPAN><SPAN LANG="en-us"> </SPAN><A \
HREF="mailto:Keith.Steiger@fei.com"><SPAN LANG="en-us"></SPAN><SPAN \
LANG="en-us"><U><FONT COLOR="#0000FF" SIZE=2 \
FACE="Arial">Keith.Steiger@fei.com</FONT></U></SPAN><SPAN \
LANG="en-us"></SPAN></A><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><BR> \
</SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 \
FACE="Arial"> (who hasn</FONT></SPAN><SPAN \
LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 \
FACE="Arial">’</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT \
SIZE=2 FACE="Arial">t ever coded in KDE before)</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN></P>
</BODY>
</HTML>
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
--===============0249214204==--
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic