public override bool OnKeyDown(Event e)
{
return false;
/* now unsupported
if (e.AltKey) return false;
if (Focused) {
if (e.CtrlKey) {
if (e.KeyCode == 65) {
DragPosition = 0;
CursorPosition = Text.Length;
} else if (e.KeyCode == 67) {
// _H.copy_to_clipboard(this.text.substring(Math.min(this.cursorPosition, this.dragPosition), Math.max(this.cursorPosition, this.dragPosition)));
} else if (e.KeyCode == 88) {
// _H.copy_to_clipboard(this.text.substring(Math.min(this.cursorPosition, this.dragPosition), Math.max(this.cursorPosition, this.dragPosition)));
Text = Text.Substring(0, Math.Min(CursorPosition, DragPosition)) +
Text.Substring(Math.Max(CursorPosition, DragPosition), Text.Length);
CursorPosition = Math.Min(CursorPosition, DragPosition);
DragPosition = -1;
}
} else if (e.KeyCode == 37) {
if (e.ShiftKey) {
if (DragPosition == -1)
DragPosition = CursorPosition;
CursorPosition = Math.Max(CursorPosition - 1, 0);
} else {
DragPosition = -1;
CursorPosition = Math.Max(CursorPosition - 1, 0);
}
} else if (e.KeyCode == 39) {
if (e.ShiftKey) {
if (DragPosition == -1)
DragPosition = CursorPosition;
CursorPosition = Math.Min(CursorPosition + 1, Text.Length);
} else {
DragPosition = -1;
CursorPosition = Math.Min(CursorPosition + 1, Text.Length);
}
} else {
if (e.KeyCode == 8) {
if (DragPosition == -1)
Text = Text.Substring(0, CursorPosition - 1) + Text.Substring(CursorPosition, Text.Length);
else {
Text = Text.Substring(0, Math.Min(CursorPosition, DragPosition)) +
Text.Substring(Math.Max(CursorPosition, DragPosition), Text.Length);
}
if (DragPosition == -1) {
if (CursorPosition > 0)
CursorPosition--;
} else
CursorPosition = Math.Min(CursorPosition, DragPosition);
} else if (e.KeyCode == 46) {
if (DragPosition == -1)
Text = Text.Substring(0, CursorPosition) + Text.Substring(Math.Min(CursorPosition + 1, Text.Length), Text.Length);
else {
Text = Text.Substring(0, Math.Min(CursorPosition, DragPosition)) +
Text.Substring(Math.Max(CursorPosition, DragPosition), Text.Length);
}
if (DragPosition == -1) {} else
CursorPosition = Math.Min(CursorPosition, DragPosition);
} else {
var m = (char) e.KeyCode;
var t = String.FromCharCode(m);
if (DragPosition == -1)
Text = Text.Substring(0, CursorPosition) + t + Text.Substring(CursorPosition, Text.Length);
else {
Text = Text.Substring(0, Math.Min(CursorPosition, DragPosition)) + t +
Text.Substring(Math.Max(CursorPosition, DragPosition), Text.Length);
}
if (DragPosition == -1)
CursorPosition++;
else
CursorPosition = Math.Max(CursorPosition, DragPosition);
}
DragPosition = -1;
}
if (TextChanged != null)
TextChanged();
e.PreventDefault();
return true;
}
return false;
*/
}