Example #1
0
        private void dataGridViewTscscan_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            tscscan tscItem = (tscscan)dataGridViewTscscan.CurrentRow.DataBoundItem;

            txtChar.Text = tscItem.unshiftedchar.ToString() +
                           ", 0x" + tscItem.unshiftedchar.ToString("x02") +
                           ", '" + Convert.ToChar(tscItem.unshiftedchar) + "'";
            txtChar.Refresh();
            txtScancode.Text = tscItem.scancode.ToString() +
                               ", 0x" + tscItem.scancode.ToString("x02") +
                               ", " + ScanCodes.scancode.scancodesUS[tscItem.scancode]._keyChar;
            txtScancode.Refresh();
        }
Example #2
0
        private void dataGridViewShiftList_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            tscshift tscShiftItem = (tscshift)dataGridViewShiftList.CurrentRow.DataBoundItem;

            txtCharIn.Text = tscShiftItem.charcodeIn.ToString() +
                             ", 0x" + tscShiftItem.charcodeIn.ToString("x02") +
                             ", '" + Convert.ToChar(tscShiftItem.charcodeIn) + "'";
            txtCharIn.Refresh();
            txtCharOut.Text = tscShiftItem.charcodeOut.ToString() +
                              ", 0x" + tscShiftItem.charcodeOut.ToString("x02") +
                              ", '" + Convert.ToChar(tscShiftItem.charcodeOut) + "'";
            txtScancode.Refresh();
            txtShifted.Text = tscShiftItem.shifted == 1 ? "true" : "false";
            txtShifted.Refresh();

            if (dataGridViewTscscan.Rows.Count > 0)
            {
                //lookup charcodeOut in tscscan, simply scroll to row with index
                dataGridViewTscscan.ClearSelection();
                dataGridViewTscscan.Rows[tscShiftItem.charcodeOut].Selected = true;

                dataGridViewTscscan.FirstDisplayedScrollingRowIndex = dataGridViewTscscan.SelectedRows[0].Index;
                tscscan tscScanItem = (tscscan)dataGridViewTscscan.Rows[tscShiftItem.charcodeOut].DataBoundItem;

                dataGridViewTscscan.CurrentCell = dataGridViewTscscan.SelectedRows[0].Cells[0];
                dataGridViewTscscan_CellClick(new object(), new DataGridViewCellEventArgs(0, dataGridViewTscscan.SelectedRows[0].Index));

                txtFunction.Text = "Typed: " + (tscShiftItem.shifted == 1 ? "Shift+" : "Normal+") + Convert.ToChar(tscShiftItem.charcodeOut) + " (" +
                                   Convert.ToChar(tscShiftItem.charcodeIn) + ")" +
                                   "==>>" +
                                   ", 0x" + tscScanItem.scancode.ToString("x02") + ", " +
                                   (tscShiftItem.shifted == 1? ScanCodes.scancode.scancodesUS[tscScanItem.scancode].Shifted:ScanCodes.scancode.scancodesUS[tscScanItem.scancode].Normal);

                int    scancode = tscScanItem.scancode;
                int    shifted  = tscShiftItem.shifted;
                string deKeybd  = (shifted == 1 ? ScanCodes.scancode.scancodesDE[scancode].Shifted : ScanCodes.scancode.scancodesDE[scancode].Normal);
                string usKeybd  = (shifted == 1 ? ScanCodes.scancode.scancodesUS[scancode].Shifted : ScanCodes.scancode.scancodesUS[scancode].Normal);
                txtFunction.Text += " DE='" + deKeybd + "', US='" + usKeybd + "'";
                txtFunction.Refresh();
            }
        }