From:  "harvinder" <junky@junkyard.com>
Date:  02 Dec 2004 19:31:18 Hong Kong Time
Newsgroup:  news.mozilla.org/netscape.public.mozilla.editor
Subject:  

listening to key events and resize event for DIV element

NNTP-Posting-Host:  132.186.123.30

Hi,
    I am trying to listen to resize and keypress dom events, I have written
C++ code for it. I am able to listen to the mousemove (and mouse related
events), however I am not been able to listen to keypress or resize events.

Below is a snippet of code.

NS_IMETHODIMP NoteBar::HandleEvent(nsIDOMEvent *event)

{

nsCOMPtr mouseEvent ( do_QueryInterface(event) );

nsAutoString type;

.....................................

....................................

return NS_OK;

}


NS_IMETHODIMP NoteBar::SomeFunction()

{

........................

nsCOMPtr noteTarget(do_QueryInterface(mNoteElementP));



noteTarget->AddEventListener(NS_LITERAL_STRING("mouseover"), this, PR_TRUE);

noteTarget->AddEventListener(NS_LITERAL_STRING("mouseout"), this, PR_TRUE);

noteTarget->AddEventListener(NS_LITERAL_STRING("resize"), this, PR_TRUE);

noteTarget->AddEventListener(NS_LITERAL_STRING("resize"), this, PR_TRUE);

}