I have been searching google for a couple days and i can't find anything on hokeys that work with unfocused/focused app....Can someone tell me how to make a hotkey that works for a unfocused app?
Respect List:
Nooby Banana
Bombsaway
Luke
Did you try calling the native RegisterHotkey Method? You'll have to pInvoke it though
(dllimport etc)
Great Virtual Keys....Again...Can someone show me a example of VK's i have googled it i can't find any good examples.
Respect List:
Nooby Banana
Bombsaway
Luke
Wow man ur going to have to learn to read API documentation... I mean, this is getting old. You can't just post everytime you don't know how to do something. atleast try to attempt it, post some source or something...
Once u find the function if u don't know how to use it its because u don't know C#... =/
"Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."- Dwight D. Eisenhower
Virtual-Key Codes (Windows)
That was in the link I gave you before, didn't see it?Parameters
vKey [in]
int
Specifies one of 256 possible virtual-key codes. For more information, see Virtual Key Codes.
You can use left- and right-distinguishing constants to specify certain keys. See the Remarks section for further information.
Err i do try before i post...actually i i try alot...and i cant post my source its to big but i ask mpgh because you all great coders i small noob coder...and i do research and stuff. When i get to the point of where i searched a couple of day and im getting no where i come here.
Respect List:
Nooby Banana
Bombsaway
Luke
try this one (you'll need to download this file from the web tough (don't have the link nao (reinstalled windows + it wasn't compatible with 2010 only 2008)).
(there may be another thing then Globalevent that u can use but haven't found it yet.)
Globalevent_KeyDown (object sender,object KeyEventArgs e)
{
switch(e.KeyCode)
{
case Keys. (*YOUR KEY*):
(exsample) timer1.start
break;
case Keys. (*YOUR KEY*):
(exsample) timer1.stop
break;
case Keys. (*YOUR KEY*):
(exsample) timer2.start
break;
(ect.)
}
}
Last edited by Kuro Tenshi; 04-26-2010 at 02:41 AM.
@ Anime Section,Otaku/weeabo (orz.) @Graphics Section, Novice DigiArtist
neuest gift from Yura~Chan:
https://bakyurayuu.deviantar*****m/#/d372taw
2nd Place MOTM#9 Theme: CharMods - Combat Arms [No - Thanks] button
come on you know that don't want to push that ordinary button
well that doesnt work for unfocused forms...
in my opinion that should be done this way:
in attachements i add a file with an enumeration of the keyboard keys and the respective bytes.Code:[DllImport("user32.dll", SetLastError = true)] static extern Int16 GetAsyncKeyState(UInt16 virtualKeyCode); private void backGroundWorker1_RunWorkerAsync(...) { while (true) { if (GetKeyState( your vk key in bytes (eg. 0x2D - VK_INSERT) ) < 0) { // you get here when your key is pressed } System.Threading.Thread.Sleep(50); } }
i had this code before but it didn't work that well i have to say most keys didn't even work.
@ Anime Section,Otaku/weeabo (orz.) @Graphics Section, Novice DigiArtist
neuest gift from Yura~Chan:
https://bakyurayuu.deviantar*****m/#/d372taw
2nd Place MOTM#9 Theme: CharMods - Combat Arms [No - Thanks] button
come on you know that don't want to push that ordinary button
Srry that i need to double post but the way to make a getasynckeystate to work is precisely the same as VB only then you wont need to add ; behind it:
if u make a form or something just use a timer like i do:
Code:public void hotkeyTest() { Boolean hotkey1; hotkey1 = GetAsyncKeyState(Keys.Multiply); if (hotkey1 == true) { //your event } } private void tHotkey1_Tick(object sender, EventArgs e) { hotkeyTest(); }
Last edited by Kuro Tenshi; 05-15-2010 at 12:19 AM.
@ Anime Section,Otaku/weeabo (orz.) @Graphics Section, Novice DigiArtist
neuest gift from Yura~Chan:
https://bakyurayuu.deviantar*****m/#/d372taw
2nd Place MOTM#9 Theme: CharMods - Combat Arms [No - Thanks] button
come on you know that don't want to push that ordinary button