How to run code when pressing physical trigger?

124 Views Asked by At

I'm programming a Symbol Motorola Hand Held with a C# Windows CE Application and I need to run a code when the physical trigger of the hand held is pressed. How can I achieve that?

I already tried to assign the button of the form as a default button, but can't do it in the properties of the form. Also, I tried to use the trigger class in Symbol.ResourceCoordination.

    private void Form1_Load(object sender, EventArgs e)
    {
        Symbol.ResourceCoordination.Triggertrigger = new Trigger();
        //trigger.Stage1Notify += new Symbol.ResourceCoordination.Trigger.TriggerEventHandler(Trigger_Stage2Notify);
        trigger.Stage2Notify += new Symbol.ResourceCoordination.Trigger.TriggerEventHandler(Trigger_Stage2Notify);
    }

    void Trigger_Stage2Notify(object sender, Symbol.ResourceCoordination.TriggerEventArgs e)
    {
        MessageBox.Show("Pressed trigger");
    }
1

There are 1 best solutions below

0
Darryn Campbell On BEST ANSWER

If you have EMDK for .NET installed you should find a sample for CS_ResCoordSample1 located under C:/Users/Public/Motorola EMDK for .NET/vx.x/Samples VS2008/. This sample should show how to capture the trigger key. If you do not have EMDK for .NET installed or need to reinstall it you can download it from https://www.zebra.com/us/en/support-downloads/software/developer-tools/emdk-for-net.html