A
abhijit.divekar
Hi,
I am in a BHO written in C++ (IE7).
Here's what I want to achieve: When the onkeypress event fires when I
press a key in an input html element, I want to "add" a new key to the
input field on the webpage. So lets say if I press "a", I should see
"ax" on the screen in the i/p elem, as "x" is the fixed key i want to
add.
I am using IHTMLDocument4's createEventObject and fireEvent methods to
fire a "onkeypress" event from within the handler of an (another)
"onkeypress" event. I am getting these onkeypress events on a text
input html element (i.e. a input test box on an html page). So I have
an IHTMLEventObj off which I am able to base the new event object I am
creating.
In the new event obj I just created I put the Keycode (pNewEvObj-
In fact the event is also getting fired but I dont see my "x" in the
input element.
Any ideas?
Additional info:
1. When my onkeypress gets called with the new event I just fired,
getting the keycode (get_keyCode) correctly returns 'x' , as expected.
2. The original onkeypress's IHTMLEventObj's get_srcElement and my new
IHTMLEventObj's get_srcElement return different pointers. Shouldnt
they be the same?
Thanks!
AbDiv
I am in a BHO written in C++ (IE7).
Here's what I want to achieve: When the onkeypress event fires when I
press a key in an input html element, I want to "add" a new key to the
input field on the webpage. So lets say if I press "a", I should see
"ax" on the screen in the i/p elem, as "x" is the fixed key i want to
add.
I am using IHTMLDocument4's createEventObject and fireEvent methods to
fire a "onkeypress" event from within the handler of an (another)
"onkeypress" event. I am getting these onkeypress events on a text
input html element (i.e. a input test box on an html page). So I have
an IHTMLEventObj off which I am able to base the new event object I am
creating.
In the new event obj I just created I put the Keycode (pNewEvObj-
want "x" to get added to the input element on the webpage.put_keyCode((LONG)'x')), setting it to lets say the char "x". So I
In fact the event is also getting fired but I dont see my "x" in the
input element.
Any ideas?
Additional info:
1. When my onkeypress gets called with the new event I just fired,
getting the keycode (get_keyCode) correctly returns 'x' , as expected.
2. The original onkeypress's IHTMLEventObj's get_srcElement and my new
IHTMLEventObj's get_srcElement return different pointers. Shouldnt
they be the same?
Thanks!
AbDiv