Hello all senior C++ Developers
I want my module writtent in C++ to be notified when 'I' key is pressed. How I filter the keyboard event? I know I should use this function:
int __stdcall OnDDEvent(DWORD EventType, void *EventParams)
The EventType must be DDEVENT_ON_KEYBOARD.
I am gettting stuck with *EventParams,
Should it be LWORD(*EventParams)=='I' ???
Here is the function I modified (but not working for me)
int __stdcall OnDDEvent(DWORD EventType, void *EventParams)
{
if (EventType == DDEVENT_ON_KEYBOARD)
{
if (WPARAM(EventParams)=='I')
{
MessageBox(NULL,"You Press I key",NULL,0);
}
}
return FALSE;
}
Thanks in advance.
Chattana.
How to filter the key event
Moderators:X05, Dreamer, FredB
Last edited by chattana on Thu Nov 08, 2007 8:54 pm, edited 1 time in total.
Twinhand 1027
XP
AMD X2 5600
Geforce 8600
XP
AMD X2 5600
Geforce 8600
According to this http://www.dvbdream.org/forum/viewtopic.php?t=582
Rel said that EventParams is the pointer, and we must typecast it. I do know typecast in general, but not in this case to get the correct result.
Could anybody help?
Rel said that EventParams is the pointer, and we must typecast it. I do know typecast in general, but not in this case to get the correct result.
Could anybody help?
Twinhand 1027
XP
AMD X2 5600
Geforce 8600
XP
AMD X2 5600
Geforce 8600
yes, it is a pointer to an integer for DDEVENT_ON_KEYBOARD.
one of the following lines should work in C
*(int *)EventParams
*(int *)(EventParams)
*((int *)(EventParams))
if( *(int *)EventParams == 'I' )
{
MessageBox(NULL,"You Press I key",NULL,0);
}
you can fill/clear the Integer with 0 after processing (if you want DD's not to handle that keyboard key, and you will take care of it in the module)
*(int *)EventParams = 0;
one of the following lines should work in C
*(int *)EventParams
*(int *)(EventParams)
*((int *)(EventParams))
if( *(int *)EventParams == 'I' )
{
MessageBox(NULL,"You Press I key",NULL,0);
}
you can fill/clear the Integer with 0 after processing (if you want DD's not to handle that keyboard key, and you will take care of it in the module)
*(int *)EventParams = 0;
DVB Dream - because I have to dream about having time to code it
Thanks Rel.
This works: *((int *)(EventParams))
I have other question: EventParams always return one value (to be exact, the value = 73) when I press I, i, SHIFT+I, SHIFT+i, CTRL+I, CTRL+i....
Is there anyway to recoginze the lower, and upper key, and the combination with CTRL or SHIFT?
Thanks
This works: *((int *)(EventParams))
I have other question: EventParams always return one value (to be exact, the value = 73) when I press I, i, SHIFT+I, SHIFT+i, CTRL+I, CTRL+i....
Is there anyway to recoginze the lower, and upper key, and the combination with CTRL or SHIFT?
Thanks
Twinhand 1027
XP
AMD X2 5600
Geforce 8600
XP
AMD X2 5600
Geforce 8600
Return to “Module / Plugin Programming”
Who is online
Users browsing this forum: No registered users and 1 guest