I'd like to intercept Ctrl key and click on datagrid line. I know how to do test if user click on datagrid line but how to add Ctrl event?
Firs part works like this:
<mx:DataGrid id="dgRDVt" fontWeight="normal"
dataProvider="{acList}"
width="100%" height="85%" change="dgRdvPat_changeHandler(event)">
<mx:columns>
...
Thanks for helping
You have to use a MouseEvent.CLICK
handler to determine this.
MouseEvent
has a couple of properties to know if the user is pressing the Ctrl key while clicking. ctrlKey detects if they are doing it on Windows or Linux. controlKey is cross platform (works on Mac too).
So you should check the value of the controlKey
property of the MouseEvent
. Add a mouse click handler to the grid:
<mx:DataGrid click="onDataGridClick(event)"/>
Then in the event handler:
private function onDataGridClick(event:MouseEvent):void
{
if (event.controlKey)
{
// do something
}
}