using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace BO.BarCodeScan
{
  public class BwpBarCodeUtil
  {
    /// <summary>
    /// 根据按键获取字符串
    /// </summary>
    /// <param name="e"></param>
    /// <returns></returns>
    public static string GetStringByKeyKeyEventArgs(KeyEventArgs e)
    {
      if (e.KeyData == (Keys.D7 | Keys.Shift))
      {
        return "&";
      }
      if (e.KeyData == (Keys.Oem1 | Keys.Shift))
      {
        return ":";
      }

      if (e.KeyData == (Keys.Oem2))
      {
        return "/";
      }
      if (e.KeyData == (Keys.OemPeriod))
      {
        return ".";
      }
      if (e.KeyData == (Keys.Oem2 | Keys.Shift))
      {
        return "?";
      }

      if (e.KeyData == (Keys.Oemplus))
      {
        return "=";
      }

      char keyvalue = (char)e.KeyValue;
      var str = keyvalue.ToString();
      return str;
    }
  }
}
