タッチ スクリーン キオスクの開発を終えたところです。物理キーボードはありません。私もoskの制限を見つけました。
グラフィックデザイナーの助けを借りて、独自のキーボード、キーの背景を持つボタン、およびボタンの意図に一致するコンテンツ (またはタグ) を作成しました。ほとんどのボタンを、選択したコントロールの CaretIndex にテキストを挿入する共通のイベント ハンドラーに割り当てます。
DEL と ENTER には別のハンドラを使用します。
私のアプリケーションでは、テキスト ボックス、目的のキーボード (英字、数字、両方など)、ユーザーに入力を求める便利な文、目的の形式を示すプレースホルダーを含む新しいウィンドウをポップアップ表示します。
これは非常にうまく機能し、ユーザー エクスペリエンスを完全に制御できます。
private void key_Click(object sender, RoutedEventArgs e)
{
_activeControl.SelectedText = (string)((Control)sender).Tag;
_activeControl.CaretIndex += _activeControl.SelectedText.Length;
_activeControl.SelectionLength = 0;
_activeControl.Focus();
}
private void btnDEL_Click(object sender, RoutedEventArgs e)
{
var ci = _activeControl.CaretIndex;
if (ci > 1)
{
_activeControl.Text = _activeControl.Text.Remove(
_activeControl.CaretIndex - 1, 1);
_activeControl.SelectionStart = ci - 1;
}
else if (_activeControl.Text.Length > 0)
{
_activeControl.Text = _activeControl.Text.Remove(0, 1);
}
_activeControl.Focus();
}
private void btnEnter_Click(object sender, RoutedEventArgs e)
{
// Raise an event here, signalling your application
// to validate and move to the next field
}