EmptyVoid

Members
  • Content count

    1026
  • Joined

  • Last visited

Community Reputation

102 Neutral

About EmptyVoid

  • Rank
    Banned
  1. Quote:Original post by phantom Quote:Original post by EmptyVoid Ohhhh even though I think you were trying to confuse me that actually helped: No, I was giving you the information to figure it out for yourself. It's hardly my fault you are poking around in a language without bothering to learn how it works first so that a legitmate answer makes you feel confused. Jesus... you've just made my 'never help again' list. You do realize the word "pseudeo-index" or even "pseudeo index" has never been used on the entire internet? Also I thought I was already on that list. [lol]
  2. Quote:Original post by rip-off Positive stack indices are taken as absolute positions. Negative ones are relative to the top of the stack Imagine the following lua stack: 'abc' 123 true Using positive indices, we need to use 1 to access "true", 2 to access "123" and 3 to access the string 'abc'. However, using negative values we can use -1 to access 'abc', -2 to access 123 and -3 to access true. So, when you have just pushed a value on the stack (e.g. getglobal()), you wat to access the top of the stack. Instead of calling gettop(L) to find out what index it is at, you can just use -1, and this will always be the top. Oh thanks now I understand! [smile]
  3. Quote:Original post by phantom lua_isfunction operates on the stack, as such the index given is an index into the stack, where as 'LUA_GLOBALSINDEX' is a pseudeo-index to a table. Ohhhh even though I think you were trying to confuse me that actually helped: lua_getfield(g_Lua, LUA_GLOBALSINDEX, "On_Start"); if(lua_isfunction(g_Lua, -1)) { // Function is defind } I still don't understand but I think -1 is the end of the global index kinda like when you add a C function to lua and you have to read backward. I don't know why 0 is not valid and you have to use -1 but oh well... I'd be interested in a explanation if anyone knows why?
  4. Quote:Original post by Erik Rufelt Quote:Original post by EmptyVoid Quote:Original post by Erik Rufelt Documentation for RAWINPUTDEVICE: http://msdn.microsoft.com/en-us/library/ms645565(VS.85).aspx Quote: RIDEV_INPUTSINK If set, this enables the caller to receive the input even when the caller is not in the foreground. Note that hwndTarget must be specified. ... ... EDIT: Why didn't you just say so?! Well anyways thanks and next time I'll read the msdn documents more then once just to make sure I didn't miss anything... (*Sigh* The darn Windows API defies logic...) Haha, I did say so, you probably just missed it =) Read my quote again, it says exactly the flag, and that the hwndTarget must be specified. Oh Haha!!!, I'm kinda half awake but the good news is with that and HWND_MESSAGE it works exactly how I want. Even though a bit more complex then I would have thought but still works perfect!
  5. Quote:Original post by CmpDev TO create your key logger (which is effectively what you want) use a message only window using HWND_MESSAGE. http://msdn.microsoft.com/en-us/library/ms632599(VS.85).aspx Even better!!! Thank you!!!
  6. Quote:Original post by Erik Rufelt Documentation for RAWINPUTDEVICE: http://msdn.microsoft.com/en-us/library/ms645565(VS.85).aspx Quote: RIDEV_INPUTSINK If set, this enables the caller to receive the input even when the caller is not in the foreground. Note that hwndTarget must be specified. I don't mean to be rude, but this whole thread pretty much consists of questions that would've been answered if you'd glanced through the documentation. Ofcourse you can ask instead to get an educated answer, but you could at least look it over =) I suggest it mostly for your own benefit. Once you learn to use the available documentation and search tools, your development process will be quite significantly sped up. I for one haven't even tried using this API, still I'm answering your questions. Also you can benefit from explaining your problem in more detail in your question, together with the steps you've already taken attempting to solve your problem. Several times when I've been about to start a new topic, in the course of explaining the question well enough for everyone to understand exactly what I mean, I have found or realized the answer myself. While my more vague and not thought through questions rarely get me the answer I'm looking for. I did read every line of that and every thing that has anything to do with raw input. Yes I may have missed something but I'm quit sure there is something completely different that I need to do and just to because I'll read every line again though I'm quit sure it won't help. I may have not said so but I have tried each of your ideas and none of them have worked yet, plus many more I found on Google. Code samples: Init: RAWINPUTDEVICE Rid[2]; Rid[0].usUsagePage = 0x01; Rid[0].usUsage = 0x02; Rid[0].dwFlags = NULL; Rid[0].hwndTarget = 0; Rid[1].usUsagePage = 0x01; Rid[1].usUsage = 0x06; Rid[1].dwFlags = NULL; Rid[1].hwndTarget = 0; RegisterRawInputDevices(Rid, 2, sizeof(Rid[0])); WndProc: LRESULT CALLBACK WndProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam ) { switch( message ) { case WM_INPUT: { UINT dwSize; GetRawInputData((HRAWINPUT)lParam, RID_INPUT, NULL, &dwSize, sizeof(RAWINPUTHEADER)); LPBYTE lpb = new BYTE[dwSize]; GetRawInputData((HRAWINPUT)lParam, RID_INPUT, lpb, &dwSize, sizeof(RAWINPUTHEADER)); RAWINPUT* raw = (RAWINPUT*)lpb; if (raw->header.dwType == RIM_TYPEKEYBOARD) { } else if (raw->header.dwType == RIM_TYPEMOUSE) { // If something happend with the mouse do lua On_MouseEvent and pass the values to it. lua_getfield(g_Lua, LUA_GLOBALSINDEX, "On_MouseEvent"); lua_pushnumber(g_Lua,raw->data.mouse.lLastX); lua_pushnumber(g_Lua,raw->data.mouse.lLastY); lua_pushinteger(g_Lua,raw->data.mouse.ulButtons); lua_call(g_Lua, 3, 0); } delete[] lpb; break; } default: return DefWindowProc( hWnd, message, wParam, lParam ); } return 0; } The problem with this is that my program needs to receive inputs even if none of it's window are active. EDIT: Why didn't you just say so?! Well anyways thanks and next time I'll read the msdn documents more then once just to make sure I didn't miss anything... (*Sigh* The darn Windows API defies logic...) [Edited by - EmptyVoid on October 12, 2008 5:20:42 AM]
  7. C# but faster with more referance materials.
  8. Quote:Original post by Erik Rufelt I haven't used raw input, so I'm not sure, but I doubt it's possible without a window. I haven't actually tried it with an invisible window either, so it might not even work. By default only the top level window receives input. The documentation says this is the case for raw input too, but that you can register a specific window to receive input even when not in the foreground. However, every Windows application is basically a window, and I guess the API is designed with that in mind. There is seldom if ever any good reason to receive input without a window to display it in. You would probably have to use a lower level API to get such information without a window. No it didn't work but thats probably because it's not the active window so it's messages do not get processed but I think there is a way to fix that but I don't know how...
  9. Quote:Original post by Erik Rufelt You can't change the desktop window's WndProc. From MSDN for SetWindowLongPtr http://msdn.microsoft.com/en-us/library/ms644898(VS.85).aspx Quote: The SetWindowLongPtr function fails if the process that owns the window specified by the hWnd parameter is at a higher process privilege in the User Interface Privilege Isolation (UIPI) hierarchy than the process the calling thread resides in. Microsoft Windows XP and earlier: The SetWindowLongPtr function fails if the window specified by the hWnd parameter does not belong to the same process as the calling thread. And also: Quote: Calling SetWindowLongPtr with the GWLP_WNDPROC index creates a subclass of the window class used to create the window. An application can subclass a system class, but should not subclass a window class created by another process. I suggest you create an invisible window, and have it handle your messages. Many Windows programs do that, even built-in Microsoft programs. Is that really the only option? It just seems a bit ridiculous.
  10. Quote:Original post by SiCrane You know, acting like an ass towards people trying to help you might explain why you have a 0 rating. Have fun figuring this out. Sorry I didn't even know I was being an ass, I'll try to say things that sound more friendly from now on then...
  11. Quote:Original post by SiCrane That depends entirely on what you mean by "raw input data". I would think it's pretty clear but I'll explain. I need to get the raw data from a Mouse, Keyboard, Gamepad, etc, using the win32 API command GetRawInputData but it is called in a window's WndProc function when it receives a WM_INPUT message, so now do you understand?
  12. Well I don't see any reason to keep this thread open since I need to make a demo to really show my skillz so Phantom you can close it now if you way. =P (On a side note, did you know that if you get air inside you it gets absorbed it 2-3 weeks?)[smile]
  13. Quote:Original post by Oluseyi Would you buy my game? No. I know too much about your programming skills... or lack thereof. I'm only half joking. I just started learning C++ like last year... I used to do awesome stuff with managed code! At least 95% of my experiance in programing is with managed code one would figure thats the reason for using C++ wrong. (Was 7 now 20, 13 years programing < 1.5 years in C++)
  14. Quote:Original post by WanMaster Quote:Original post by EmptyVoid just answer the question... You've worked on it for the last five years and it's still only an idea in your head? No mockups, no prototypes? Sorry, I'm not sold: no. </dragon's den> I have prototypes of different pieces of the engine and a mockup but I had to learn a lot of new stuff since then because I used to use Visual basic 6.0 / DirectX7. Then I learned: C#, C++, DirectX 8-10, OpenGL (Then went back to DirectX), then I spent some time learning php, java script, 3DS Max script, Maya MEL script, Rendering procedural planets, made a few crappy games, HLSL, write plugins for Photoshop for a custom format then decided to just export it in my max exporter, rebuilt the engine 20 times, build my own scripting language then decided to use lua, the list goes on and on... Oh then there was a year were I didn't have a computer so it was actually 4 years... actually MOST of this was after I got a new computer and joined here... Main reason being I didn't have the internet so it was VERY hard to learn stuff... Quote:Original post by zer0wolf No, it doesn't sound like I'd buy the game based off of your description. I'd have to play an actual demo first and determine my purchase off of my experience with it hands-on. Ok I'll have to make a demo soon then! [smile]