Intercept/block existing javascript keybind Programming Web Development by MDGM … it is possible and how to intercept an existing javascript keybind and block it. For example, a website has some javascript… Re: Intercept/block existing javascript keybind Programming Web Development by hielo If your page contains a frame, and THAT frame contains and EXTERNAL/REMOTE page that contains the javascript that is "listening" for the "H" keypress, then you will NOT be able to rebind the event. In other words, what you are trying to do is not possible. The security restrictions imposed by the browser will not give you … Re: Intercept/block existing javascript keybind Programming Web Development by MDGM Thanks for your reply, The process does not involve any iFrames. I am going to use this in a browser add-on and so the javascript will be inserted directly into the page as if I was the developer of that website and just inserting code as normal. Max Re: Intercept/block existing javascript keybind Programming Web Development by hielo then you will need to do so AFTER the page has loaded. To clarify, basically this is what needs to be done: [CODE] //assuming this is what is there initially document.body.onkeypress=function(){ //code that "listens" for "H" ... }; [/CODE] then you need to override that listener after page load: [CODE] onload=function(){ … Re: Intercept/block existing javascript keybind Programming Web Development by MDGM Iv had a go at that, the key I need to override is backspace but entering the backspace code (8) does not seem to work. How should that work? Re: Intercept/block existing javascript keybind Programming Web Development by Airshow [QUOTE=MaxMumford;1354736].... browser add-on .....[/QUOTE] ????? Re: Intercept/block existing javascript keybind Programming Web Development by sheva249 Thanks hielo for your post. It is really very appreciated. Re: Intercept/block existing javascript keybind Programming Web Development by hielo [CODE]Iv had a go at that, the key I need to override is backspace but entering the backspace code (8) does not seem to work. How should that work? [/CODE] it will be better if you post what you have @Airshow: I suspect he's developing something similar to a Greasemonkey script/"extension" Re: Intercept/block existing javascript keybind Programming Web Development by Airshow Hielo, [QUOTE=hielo;1358400]@Airshow: I suspect he's developing something similar to a Greasemonkey script/"extension"[/QUOTE] Aha! Thanks, this topic makes sense now. [B]Airshow[/B] Key Bind Programming Software Development by charqus Hello guys. Can somebady help me to make a keybind for Gta San Andreas MultiPlayeri ? Look what i'm talking … Noob Question - Key Shortcuts Programming Software Development by PixelatedKarma … working in Visual C++ and trying to make a "keybind" for my program, so that when that key (lets… Re: vim after new installation Hardware and Software Linux and Unix by JasonHippy …;<CR>:<backspace> " Set up a keybind to switch from header to cpp " F4 - Go to… Re: vim after new installation Hardware and Software Linux and Unix by JasonHippy …. But I've never had a problem with my F4 keybind. Re: Noob Question - Key Shortcuts Programming Software Development by mike_2000_17 You need some sort of use of windows API to catch keystrokes directly (including mod-states, like ctrl and shift). With win32 API, you need to make a [URL="http://www.toymaker.info/Games/html/wndproc.html"]WindowProc[/URL] function and handle the WM_KEYDOWN (Windows Message - Key-down event). Then, it is just a matter of writing a big … Re: Noob Question - Key Shortcuts Programming Software Development by m4ster_r0shi To add to the above, if you don't want to create a window, you can also use this -> [url]http://msdn.microsoft.com/en-us/library/ms646293(v=vs.85).aspx[/url] Re: Noob Question - Key Shortcuts Programming Software Development by PixelatedKarma Thanks guys for the response, I tried doing the second one and forgive me for asking this and I know it seems silly but this goes into my app.h versus going into my app.cpp right? So what I would be writing in the end would also be: SHORT WINAPI GetAsyncKeyState(0x41);{ // my code } 0x41 for the A key would that be then correct? Sorry if these … Re: Noob Question - Key Shortcuts Programming Software Development by raptr_dflo I use a really nice free color-grabber utility on Windows, so haven't bothered coding my own. I'd recommend searching for "keyboard focus" ... since you want your program to keep grabbing keyboard events even while other applications are in the foreground. Re: Noob Question - Key Shortcuts Programming Software Development by PixelatedKarma Thanks for the reply raptr - found some stuff on MSDN but cannot find any examples of how it should look like. This is what MSDN says it should be: public: static IInputElement^ Focus( IInputElement^ element ) So I'm guessing that the code structure in the app.h should look like: [CODE=c++] public: static IInputElement^ Focus(mykey) { //My… Re: Noob Question - Key Shortcuts Programming Software Development by m4ster_r0shi [QUOTE=PixelatedKarma]will that work if my program is running in the background of another program?[/QUOTE] Absolutely. GetAsyncKeyState is perfect for implementing global hotkeys. And keyloggers :D Here's a minimal example: [CODE]#include <windows.h> #include <iostream> bool IsPressed(int virtual_key) { return GetAsyncKeyState(… Re: Noob Question - Key Shortcuts Programming Software Development by PixelatedKarma This is what I went with the compiler is giving me the following errors: line 12 - warning 4800 - 'int': forcing value to bool 'true' or 'false' error LNK2028: unresolved token error LNK2019: unresolved external symbol and line 12 is: return GetAsyncKeyState(virtual_key) >> 15; I can post more of the warnings/errors if need be. [CODE… Re: Noob Question - Key Shortcuts Programming Software Development by m4ster_r0shi Why do you use managed C++ for this? Try creating an new, [B]empty[/B] project, then add a main.cpp file and paste the code there.