// Get Device Layout private void ButtonDeviceLayout_Click(object sender, RoutedEventArgs e) { // Get the current keyboard layout of the device Sharp_SDK.LAYOUT_KEYOBARD kbdLayout = Sharp_SDK.SDK.GetDeviceLayout(); string strKbdLayout = kbdLayout.ToString(); tbLayout.Text = strKbdLayout; }
// Check if Device is plugged in private void ButtonDevicePlug_Click(object sender, RoutedEventArgs e) { bool isPluggedIn = Sharp_SDK.SDK.IsDevicePlug(); Sharp_SDK.LAYOUT_KEYOBARD kbl = Sharp_SDK.SDK.GetDeviceLayout(); isPluggedIn = isPluggedIn && (kbl != Sharp_SDK.LAYOUT_KEYOBARD.LAYOUT_UNINIT); MessageBox.Show(isPluggedIn ? "Connected!" : "Removed!"); }