PDA

View Full Version : Global shortcut + other program



deemeetar
27th September 2009, 18:40
Hello.
I'm building an app that will help me in playing games(not a cheat).
So first of all, is there a way how to make when my app is minimized to the system try(building for windows mainly)while play game in the same time(lets say counter strike) and i press some button/combinations of buttons my app to catch the signal. So, i am inside the game, playing it but my application waits for the sygnal.

Second i need to build in my application is when it catches that signal to send some signal like i did it with my keyboard.

The example application that i've seen is a program than makes short words larger. For example when someone write bbl the aplication returned "be back later" in the game.

I know its something specific, but i didn't know how to search for it, so if you give me some example it would be good.

Thank you deemeetar.

jpn
27th September 2009, 19:12
See QxtGlobalShortcut (http://doc.libqxt.org/tip/classQxtGlobalShortcut.html)

deemeetar
28th September 2009, 21:15
Can anyone show me some example 'cos im newbie, don't realy get it how to use it.

jpn
28th September 2009, 22:00
What have you tried so far? Did you manage to download, build and install Qxt?

jpn
28th September 2009, 22:09
Here are snippets from one of the Qxt test apps:


int main(int argc, char* argv[])
{
QxtApplication app(argc, argv);
// ...
}




QxtGlobalShortcut* shortcut = new QxtGlobalShortcut(this);
connect(shortcut, SIGNAL(activated()), this, SLOT(toggleVisibility()));
if (!shortcut->setShortcut(QKeySequence("Ctrl+Shift+Alt+S")))
// ...

PS. QxtApplication is no more needed in the development version (upcoming 0.6 version).

deemeetar
28th September 2009, 22:16
I can't install qxt. Here is what i do.:
Download and extract
Run vs2008 cmd
go to the extracted folder
run configure -msvc
run nmake and it gives me:

C:\Users\Dimitar\Documents\Downloads\libqxt-0.5.0\libqxt-0.5.0>nmake

Microsoft (R) Program Maintenance Utility Version 9.00.21022.08
Copyright (C) Microsoft Corporation. All rights reserved.

cd tools\doqsy\ && mingw32-make -f Makefile
mingw32-make -f Makefile.Debug
Makefile.Debug:60: *** missing separator. Stop.
mingw32-make[1]: Entering directory `C:/Users/Dimitar/Documents/Downloads/libqxt
-0.5.0/libqxt-0.5.0/tools/doqsy'
mingw32-make[1]: Leaving directory `C:/Users/Dimitar/Documents/Downloads/libqxt-
0.5.0/libqxt-0.5.0/tools/doqsy'
mingw32-make: *** [debug] Error 2
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
First it saied qmake is not in the path so i added:

C:\Qt\4.5.2\qmake; to the path, than it tried to compile but the error happens.

Sollution please.

jpn
29th September 2009, 10:16
It almost looks like you have run configure multiple times. One time it detected mingw32-make in your environment, and generated makefiles for that. Another time you ran configure -msvc, which generated visual studio project files (not makefiles!). Then you try to compile with nmake, which uses makefiles generated for mingw32-make.

deemeetar
29th September 2009, 11:23
Ok, i extracted it aggain.
Than using command prompt(the system default one) i went to the extracted location:

C:\libqxt\libqxt-0.5.0
Then i wrote
configure
and then i wrote

mingw32-make
but error aggain.
Here is the whole console text:

C:\libqxt\libqxt-0.5.0>configure
Testing for qmake...
Testing for mingw32-make...
Using mingw32-make.
Testing for optional external libraries.
If a test fails, some features will not be available.
Testing for OpenSSL...
OpenSSL disabled.
Testing for Berkeley DB...
Berkeley DB disabled.
Configuration successful.
Generating makefiles...
Project MESSAGE: building core module
Project MESSAGE: building gui module
Project MESSAGE: building network module
Project MESSAGE: building sql module
Project MESSAGE: building web module
Project MESSAGE: building crypto module
Reading C:/libqxt/libqxt-0.5.0/tools/doqsy/doqsy.pro
Reading C:/libqxt/libqxt-0.5.0/src/core/core.pro
Reading C:/libqxt/libqxt-0.5.0/src/gui/gui.pro
Reading C:/libqxt/libqxt-0.5.0/src/designer/designer.pro
Reading C:/libqxt/libqxt-0.5.0/src/network/network.pro
Reading C:/libqxt/libqxt-0.5.0/src/sql/sql.pro
Reading C:/libqxt/libqxt-0.5.0/src/web/web.pro
Reading C:/libqxt/libqxt-0.5.0/src/crypto/crypto.pro
Makefiles generated. Run mingw32-make now.

C:\libqxt\libqxt-0.5.0>mingw32-make
cd tools\doqsy\ && mingw32-make -f Makefile
mingw32-make[1]: Entering directory `C:/libqxt/libqxt-0.5.0/tools/doqsy'
mingw32-make -f Makefile.Debug
Makefile.Debug:60: *** missing separator. Stop.
mingw32-make[2]: Entering directory `C:/libqxt/libqxt-0.5.0/tools/doqsy'
mingw32-make[2]: Leaving directory `C:/libqxt/libqxt-0.5.0/tools/doqsy'
mingw32-make[1]: *** [debug] Error 2
mingw32-make[1]: Leaving directory `C:/libqxt/libqxt-0.5.0/tools/doqsy'
mingw32-make: *** [sub-tools-doqsy-make_default] Error 2

jpn
29th September 2009, 15:43
Is the qmake you have in PATH for Qt/MinGW or Qt/MSVC?

deemeetar
29th September 2009, 17:42
C:\Qt\4.5.2\qmake

jpn
29th September 2009, 19:20
Yes, but is that a MSVC or MinGW installation? You can't mix the two.

deemeetar
29th September 2009, 19:59
When i was installing qt(regular one) i used msvc and Jom for faster compiling.

jpn
29th September 2009, 20:15
Hmm, perhaps removing C:\MinGW\bin from PATH and re-running configure helps? Alternatively you could set QMAKESPEC environment variable to "win32-msvc2008", "win32-msvc2005"... depending on the version you use. This way the configure script ends up using nmake as it should.

deemeetar
29th September 2009, 20:29
no luck aggain.
First i removed mingw from the path, like you said.
Then i runned configure -msvc from the vs2008 cmd, than i tried to make namake:

C:\libqxt\libqxt-0.5.0>configure -msvc
Testing for qmake...
Testing for mingw32-make...
Testing for nmake...
Using nmake.
Testing for optional external libraries.
If a test fails, some features will not be available.
Testing for OpenSSL...
OpenSSL disabled.
Testing for Berkeley DB...
Berkeley DB disabled.
Configuration successful.
Generating makefiles...
Project MESSAGE: building core module
Project MESSAGE: building gui module
Project MESSAGE: building network module
Project MESSAGE: building sql module
Project MESSAGE: building web module
Project MESSAGE: building crypto module
Reading C:/libqxt/libqxt-0.5.0/tools/doqsy/doqsy.pro
Reading C:/libqxt/libqxt-0.5.0/src/core/core.pro
Reading C:/libqxt/libqxt-0.5.0/src/gui/gui.pro
Reading C:/libqxt/libqxt-0.5.0/src/designer/designer.pro
Reading C:/libqxt/libqxt-0.5.0/src/network/network.pro
Reading C:/libqxt/libqxt-0.5.0/src/sql/sql.pro
Reading C:/libqxt/libqxt-0.5.0/src/web/web.pro
Reading C:/libqxt/libqxt-0.5.0/src/crypto/crypto.pro
Project MESSAGE: building core module
Project MESSAGE: building gui module
Project MESSAGE: building network module
Project MESSAGE: building sql module
Project MESSAGE: building web module
Project MESSAGE: building crypto module
Project MESSAGE: building core module
Project MESSAGE: building gui module
Project MESSAGE: building network module
Project MESSAGE: building sql module
Project MESSAGE: building web module
Project MESSAGE: building crypto module
Makefiles generated. Run nmake now.

C:\libqxt\libqxt-0.5.0>nmake

Microsoft (R) Program Maintenance Utility Version 9.00.21022.08
Copyright (C) Microsoft Corporation. All rights reserved.

NMAKE : fatal error U1064: MAKEFILE not found and no target specified
Stop.

Then i added new enviorment, qmakespec just like you said and set it to win32-msvc2008, than ran nmake but the same error occures.

jpn
29th September 2009, 20:36
Progress. :) If you pass -msvc, it will create visual studio project files instead of makefiles. Don't pass -msvc if you want to compile from command line with nmake.

deemeetar
29th September 2009, 20:46
installed.
Okay, ill do some work for my app and then will write if i have the sollution. Thank you.