How do I get key modifiers from event [SOLVED]

currently I have a slot connected to the TCanvas signal ProcessedEvent(Int_t event, Int_t x, Int_t y, TObject* selected). I can get keypresses, mousebutton and motion events but I also need to know which keys that are down during an arbitrary event.

One modifier is available: “shift”, since the defined enum EEventType containes constants like kButton1Shift and kButton1ShiftMotion. But I need more like “ctrl” or preferably any key.

The TCanvas is really a TRootEmbeddedCanvas and I have tried to connect to the TGFrame::ProcessedEvent(Event_t* event) but then I do not get any events from the embedded TCanvas.

Why is not TCanvas sending a signal containing a Event_t pointer? How can I access the keyboard modifiers to a mouse click on a TCanvas?

Any suggestions and help are welcome.
Thanks in advance.


You should connect to the container which is actually handling (processing) the events for the canvas:

fEmbeddedCanvas->GetContainer()->Connect("ProcessedEvent(Event_t*)", "YourClass", this, "EventProcessed(Event_t*)");
If it is still not working, just post a short macro reproducing the problem.

Cheers, Bertrand.

Didn’t think of the container. I works now, thank you.