Trouble with keyboard keys under win32gdk

Hi all,
I’m experiencing some troubles with keyboard keys under win32gdk: the following code gives me some strange results:

void test_canvaskey()
  TCanvas *c= new TCanvas("Test","Test");
  c->AddExec("myexec","printf(\"Now exec with event %d\\n\",gPad->GetEvent());");

Executing I get two cases depending on mouse focus when the canvas pops out:
1) the mouse focus goes directly to che canvas: key events are recognized till the first
mouse click. After the fist click it stops seeing “key” events (i.e.
gPad->GetEvent()==24 )
2) the mouse focus is not on the canvas when the canvas pops out so that
you need to Alt-Tab or click to have focus: no “key” events can be seen

Under Linux the same macro performs well.

Maybe related: using arrows key to walk through menus (TCanvas’ ones for example)
does not work. Also using keys shortcuts to call submenus does not work. It seems
that only the menubar hotkeys are working.

As far as I remember I have never seen this macro working, so maybe this is not
an issue with the latest ROOT.

I’m using root 4.00.06a compiled from source as win32gdk, Win2k,
compiler cl version 13.10.2292

Am i missing somethig?

Hi Luigi,
thank you for reporting it. I’m trying to fix it.

Concerning arrow keys navigation it was implemented
recently (now in CVS). Handling hot keys in popup menus is
waiting to be implemented.

Thanks. Regards. Valeriy

Hi Luigi, thanks ++
It’s fixed now. Must be in CVS.

Regards. Valeriy

Hi Valeriy,
I will try it as soon as possible, thank you!!! :smiley:

BTW: I found this problem while trying to inherit from TRootEmbeddedCanvas:
is there any particular reason for having the TRootEmbeddedCanvas::HandleContainer*
methods both private and not virtual?
This makes almost impossible to handle some key event (for example :wink: )



I’ve made the HandleContainer methods protected and virtual. Idem for the data members.

Happy inheriting.

Cheers, Fons.

thank you! :slight_smile:

Hi Valeriy,
I have tried the CVS version: on my machine the “normal” keys are now properly recognized thanks to your patch :slight_smile: , whereas “special” keys (like arrows, pag up/down, function keys etc) are still not working :frowning:.
Moreover the status of the BlockNum indicator seems to affect with keys of the keypad can be seen :open_mouth: .
As you told, arrow keys are working well for menu navigation.

I did these tests using the same macro of my first post…

Thank you