Evt_char_hook and evt_char not emitting events in wxFileDialog on Mac

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
guzmanpaco
Earned a small fee
Earned a small fee
Posts: 13
Joined: Wed Aug 18, 2021 1:02 am

Evt_char_hook and evt_char not emitting events in wxFileDialog on Mac

Post by guzmanpaco »

I am using wxWidgets 3.1.0. I have an issue on wxFileDialog on Mac OS (10.12 and later). I am trying to implement support for command + w keyboard shortcut to close my windows and file dialogs on Mac OS. I performed bind event for evt_char_hook on my windows and the key shortcut works. I tried to create a bind event for evt_char_hook or evt_char on wxFileDialog. The event does not seem to trigger when I press command + w.

Is this expected?
User avatar
doublemax@work
Super wx Problem Solver
Super wx Problem Solver
Posts: 474
Joined: Wed Jul 29, 2020 6:06 pm
Location: NRW, Germany

Re: Evt_char_hook and evt_char not emitting events in wxFileDialog on Mac

Post by doublemax@work »

wxFileDialog is just a wrapper around the respective native control on each platform, so it's possible that "normal" wxWidgets events don't work.

How does this work in other OSX applications?
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Evt_char_hook and evt_char not emitting events in wxFileDialog on Mac

Post by ONEEYEMAN »

Hi,
Why not cancel the dialog?

Thank you.
guzmanpaco
Earned a small fee
Earned a small fee
Posts: 13
Joined: Wed Aug 18, 2021 1:02 am

Re: Evt_char_hook and evt_char not emitting events in wxFileDialog on Mac

Post by guzmanpaco »

@ONEEYEMAN, we need to support this unfortunately. Pressing cancel may not be enough.

@doublemax@work, it seems that on Mac, save file dialog does not support fn+w too. So it is possible that it may be out of scope for wxWidgets
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Evt_char_hook and evt_char not emitting events in wxFileDialog on Mac

Post by ONEEYEMAN »

Hi,
What is you scenario?
Maybe you can try wxAccelwratorTable?

Thank you.
Post Reply