按下物理触发器时如何运行编码?

How to run code when pressing physical trigger?

我正在使用 C# Windows CE 应用程序对 Symbol Motorola Hand Held 进行编程,当按下手持设备的物理触发器时,我需要 运行 代码。我怎样才能做到这一点?

我已经尝试将窗体的按钮指定为默认按钮,但无法在窗体的属性中执行此操作。另外,我尝试在 Symbol.ResourceCoordination 中使用触发器 class。

    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");
    }

如果您安装了 .NET 的 EMDK,您应该在 C:/Users/Public/Motorola 下找到 CS_ResCoordSample1 的示例。EMDK for .NET/vx.x/Samples VS2008/。此示例应显示如何捕获触发键。如果您没有安装用于 .NET 的 EMDK 或需要重新安装它,您可以从 https://www.zebra.com/us/en/support-downloads/software/developer-tools/emdk-for-net.html

下载它