wxRichTextCtrl Key Event Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
kea_
Experienced Solver
Experienced Solver
Posts: 59
Joined: Wed Oct 17, 2007 7:32 am

wxRichTextCtrl Key Event

Post by kea_ » Thu Oct 30, 2008 2:02 pm

Hello together,

I am using a wxRichTextCtrl in my application. Everything works fine.
I like to do the undo width the ctrl + Z keys.
But I can't get it to work.
I tryed to do it width EVT_RICHTEXT_CHARACTER and then catch the wxRichTextEvent::GetFlags() but it will not work.

Has anybody an idea?

Have a big thank
kea_

framepointer
Super wx Problem Solver
Super wx Problem Solver
Posts: 264
Joined: Mon Aug 07, 2006 3:25 pm
Location: Baia Mare, Romania
Contact:

Post by framepointer » Fri Oct 31, 2008 7:35 am

Hi.

I think you need to catch the key event using EVT_KEY.
Inside the event handler, check for

Code: Select all

void OnKeyPressed(wxKeyevent & event)
{
if((event.GetKeyCode() = 'Z' || event.GetKeyCode() = 'z') &&
 event.ControlDown())
{
  /* do some stuff */
}
else
    event.Skip();
}
I hope this helps.

Regards
Software is like sex,
It's better when it's free.
~Linus Torvalds

kea_
Experienced Solver
Experienced Solver
Posts: 59
Joined: Wed Oct 17, 2007 7:32 am

Post by kea_ » Wed Nov 05, 2008 6:59 am

Sorry for my late response. I had a lot to do.


I did the resolve in another way.

Thank your for your answer.
kea_

Post Reply