void IUserInteractive.OnPointerPress(IPointer cursor, uint button, InputEventModifier modifiers) { // We become focused. if (parent is IContainer) { (parent as IContainer).Focused = this; } else { FocusChange(true); } if (this is IContainer) { // We make sure no child is focused. (this as IContainer).Focused = null; } OnPointerPressInternal(cursor, button, modifiers); Action4 <Area, IPointer, uint, InputEventModifier> t = onMousePressed; if (t != null) { t(this, cursor, button, modifiers); } }
protected override void OnKeyPressInternal(IPointer cursor, KeyCodes code, KeyboardModifiers modifiers, InputEventModifier eventModifiers) { base.OnKeyPressInternal(cursor, code, modifiers, eventModifiers); // We are focused. animationState.TransistTo(CommonStyleStates.Focused); if (code == KeyCodes.C && (modifiers & KeyboardModifiers.LCtrl) != 0) { if (selectedRange.Y < selectedRange.X) { return; } // We have a copy event. Action3 <Label, Vector2i, StringBuilder> t = onTextCopy; StringBuilder b = new StringBuilder(SelectedText); // Events may alter copy or react on it. if (t != null) { t(this, selectedRange, b); } // We add copy to cursor. AttachedData attachedData = new AttachedData(); attachedData.ApplicationID = Guid.Empty; //< FIXME attachedData.Data = b.ToString(); attachedData.Representation = null; // We attach data. cursor.AttachData(attachedData); } }
void IUserInteractive.OnPointerPress(IPointer cursor, uint button, InputEventModifier modifiers) { if (rootObjectInteractive != null) { rootObjectInteractive.OnPointerPress(cursor, button, modifiers); } }
protected override void OnPointerPressInternal(IPointer cursor, uint button, InputEventModifier modifier) { base.OnPointerPressInternal(cursor, button, modifier); if (button == 0) { SetStyleState(CommonStyleStates.Clicked); } }
/// <summary> /// Event for buttons. /// </summary> /// <param name="owner"></param> /// <param name="buttonId"></param> /// <param name="state"></param> public InputEvent(InputDevice owner, uint buttonId, bool state, InputEventModifier modifiers, KeyboardModifiers keyModifiers) { this.owner = owner; this.type = InputEventType.Button; this.stateRecord = state ? 1 : 0; this.id = buttonId; this.inputModifiers = modifiers; this.keyboardModifiers = keyModifiers; }
protected override void OnPointerPressInternal(IPointer cursor, uint button, InputEventModifier modifiers) { base.OnPointerPressInternal(cursor, button, modifiers); IWidget child = InputRouting.GetChildAtPosition(this, manager, cursor.CanvasPosition); if (child != null) { child.OnPointerPress(cursor, button, modifiers); } }
void KeyPress(Area area, IPointer pointer, SharpMedia.Input.KeyCodes code, SharpMedia.Input.KeyboardModifiers modeifiers, InputEventModifier inputModifier) { char chr = InputTranslator.Translate(code, modeifiers); buffer.Append(chr); currentLine.Append(chr); // FIXME: maximum buffer size. if (chr == '\n') { // We signal line read. } }
protected override void OnKeyPressInternal(IPointer cursor, SharpMedia.Input.KeyCodes code, SharpMedia.Input.KeyboardModifiers modifiers, InputEventModifier eventModifiers) { base.OnKeyPressInternal(cursor, code, modifiers, eventModifiers); // We get child with focus. IWidget childWithFocus = InputRouting.GetChildWithFocus(this, manager); if (childWithFocus != null) { childWithFocus.OnKeyPress(cursor, code, modifiers, eventModifiers); } }
void IUserInteractive.OnKeyPress(IPointer cursor, KeyCodes code, KeyboardModifiers modifiers, InputEventModifier eventModifiers) { (root as IUserInteractive).OnKeyPress(cursor, code, modifiers, eventModifiers); }
void IUserInteractive.OnPointerPress(IPointer cursor, uint button, InputEventModifier modifiers) { (root as IUserInteractive).OnPointerPress(cursor, button, modifiers); }
protected virtual void OnKeyPressInternal(IPointer cursor, KeyCodes code, KeyboardModifiers modifiers, InputEventModifier eventModifiers) { }
protected virtual void OnPointerPressInternal(IPointer cursor, uint button, InputEventModifier modifiers) { }
void IUserInteractive.OnKeyPress(IPointer cursor, KeyCodes code, KeyboardModifiers modifiers, InputEventModifier eventModifiers) { OnKeyPressInternal(cursor, code, modifiers, eventModifiers); Action5 <Area, IPointer, KeyCodes, KeyboardModifiers, InputEventModifier> t = onKeyPressed; if (t != null) { t(this, cursor, code, modifiers, eventModifiers); } }
void IUserInteractive.OnKeyPress(IPointer cursor, KeyCodes code, SharpMedia.Input.KeyboardModifiers modifiers, InputEventModifier eventModifiers) { IWidget focus = FocusedWidget; if (focus != null) { focus.OnKeyPress(cursor, code, modifiers, eventModifiers); } }