summaryrefslogtreecommitdiffhomepage
path: root/FaceTrackNoIR/FaceApp.cpp
blob: 433e9b2dd5ed13d50472e6f9e2998efaf8b54ab8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include "FaceApp.h"
#include "windows.h"
#include "FTTypes.h"
#include <QDebug>

//
// Override the Application MessageFilter, to receive messages from the game(s)
//
bool FaceApp::winEventFilter( MSG * msg, long * result )
{
	int msgType = msg->message;  // test line
	
	if (msgType == msgID_FTClient) {
		qDebug() << "FaceApp::winEventFilter says: game tickles me =" << msgType << "hwnd =" << msg->hwnd;
		if (mainWindow != NULL) {
			mainWindow->getGameProgramName();
		}
	}

	////if (msgType == WM_HOTKEY) {
	////	switch ( msg->wParam ) {
	////		case 777:
	////			qDebug() << "FaceApp::winEventFilter says: HOME pressed";
	////			break;
	////		case 778:
	////			qDebug() << "FaceApp::winEventFilter says: END pressed";
	////			break;
	////		default:
	////			qDebug() << "FaceApp::winEventFilter says: unknown HotKey pressed";
	////			break;
	////	}
	////}
	return( false );
}

//
// Setup the EventFilter
//
void FaceApp::SetupEventFilter( FaceTrackNoIR *window ) {

	mainWindow = window;
	msgID_FTClient = RegisterWindowMessageA ( FT_PROGRAMID );
	qDebug() << "FaceApp::SetupEventFilter says: Message ID =" << msgID_FTClient;

	////if ( RegisterHotKey( window->winId(), 777, MOD_WIN, VK_HOME ) ) {
	////	qDebug() << "FaceApp::SetupEventFilter says: RegisterHotKey HOME =" << VK_HOME;
	////}
	////if ( RegisterHotKey( window->winId(), 778, MOD_WIN, VK_END ) ) {
	////	qDebug() << "FaceApp::SetupEventFilter says: RegisterHotKey END =" << VK_END;
	////}
	////
	////QAbstractEventDispatcher *evtdis = QAbstractEventDispatcher::instance();
	////if (evtdis != NULL) {
	////	qDebug() << "FaceApp::SetupEventFilter says: EventDispatcher found!";
	////}

}