Scylla Framework
  • API Reference
Search Results for

    Show / Hide Table of Contents
    • Scylla.Console.TextMode
      • IConsoleScreen
      • TextModeDebugConsoleDisplay
      • TicTacToeCommand
      • TicTacToeScreen
    • Scylla.TextMode
      • ANSIAttributeParser
      • ANSIColor
      • ANSISGRAttributes
      • AmbientEffectBase
      • BackgroundBlendMode
      • BoxStyle
      • BoxStyleCharacters
      • BoxStyleCharacters.BoxChars
      • CRTSettings
      • Cell
      • CellAttributes
      • CellAttributesExtensions
      • CellBuffer
      • CellBufferRenderer
      • CellGrid
      • CellMask
      • CellPosition
      • CellRange
      • CellRect
      • ColorCycleEffect
      • ColorCycleEffectPreset
      • CrossFadeEffect
      • CursorStyle
      • DecodeEffect
      • DecodeEffectPreset
      • DigitalRainEffect
      • DigitalRainEffectPreset
      • EffectsSettings
      • FadeEffect
      • FadeEffectPreset
      • FlickerEffect
      • FlickerEffectPreset
      • GlitchEffect
      • GlitchEffectPreset
      • GlyphAtlasCache
      • GridSettings
      • IAutoCompleter
      • IInputHistory
      • ITextEffect
      • ITextEffectContext
      • ITextModeGridProvider
      • ITextModePointerMapper
      • ITextModeRenderSource
      • ITextModeViewHost
      • IVTParserHandler
      • InputHistory
      • MaskTransitionEffect
      • MouseEncodingMode
      • MouseTrackingMode
      • PackedGlyphData
      • PulseEffect
      • PulseEffectPreset
      • PushEffect
      • PushEffectPreset
      • SDFSettings
      • ScrollbackAttributeRun
      • ScrollbackLine
      • ScyllaTextMode
      • ScyllaTextMode.Meta
      • ScyllaTextModeConfiguration
      • SlideInEffect
      • SlideInEffectPreset
      • StaticTuneInEffect
      • StaticTuneInEffectPreset
      • TerminalCLI
      • TerminalEmulator
      • TerminalGridRenderer
      • TerminalInputEncoder
      • TerminalMouseButton
      • TerminalScrollbackBuffer
      • TerminalSettings
      • TextAlignment
      • TextEffectBase
      • TextEffectCompletedEvent
      • TextEffectDirection
      • TextEffectExtensions
      • TextEffectMaskPattern
      • TextEffectPreset
      • TextEffectPushMode
      • TextEffectSequencer
      • TextEffectStartedEvent
      • TextEffectState
      • TextEffectTimeMode
      • TextEffects
      • TextModeCellBorder
      • TextModeColorDefaults
      • TextModeColorScheme
      • TextModeColorSet
      • TextModeConfigurationChangedEvent
      • TextModeConsole
      • TextModeConstants
      • TextModeEffectPlayer
      • TextModeGridCapture
      • TextModeLayoutUtil
      • TextModeMaterials
      • TextModeMouseReporter
      • TextModeMouseReportingEvent
      • TextModeSelectionChangedEvent
      • TextModeSelectionEndedEvent
      • TextModeSelectionManager
      • TextModeSelectionStartedEvent
      • TextModeTerminal
      • TextModeTerminalColorTheme
      • TextModeTerminalHost
      • TextModeTerminalSettings
      • TextModeTerminalStartMode
      • TextModeThemeBackground
      • TextModeThemeChangedEvent
      • TextModeThemeRemapper
      • TextModeThemes
      • TextModeView
      • TextWrapMode
      • ThemeSettings
      • TransitionEffectBase
      • TransitionEffectPreset
      • TwinkleEffect
      • TwinkleEffectPreset
      • TypewriterCharacterRevealedEvent
      • TypewriterEffect
      • TypewriterEffectPreset
      • UITextModeView
      • VTParser
      • WaveEffect
      • WaveEffectPreset
    • Scylla.TextMode.CRT
      • CRTBeam
      • CRTBeamClock
      • CRTBeamScanDirection
      • CRTBeamStatus
      • CRTCalibrationPattern
      • CRTCurvatureShape
      • CRTGeometry
      • CRTHDR
      • CRTHDRDisplay
      • CRTHDRTarget
      • CRTHorizontalKernel
      • CRTImageRegion
      • CRTMaskType
      • CRTQualityTier
      • CRTScaleMode
      • CRTSignalStandard
      • CRTSignalType
      • ITextModeCRTCameraEffect
      • ITextModeCRTHDRDisplaySource
      • TextModeCRTBeam
      • TextModeCRTCalibration
      • TextModeCRTCameraEffects
      • TextModeCRTConstants
      • TextModeCRTDriver
      • TextModeCRTHDR
      • TextModeCRTImageRenderer
      • TextModeCRTMonitor
      • TextModeCRTPreset
      • TextModeCRTPresetRegistry
      • TextModeCRTScreen
      • TextModeCRTSettings
      • TextModeCRTTube
    • Scylla.TextMode.Editor
      • CellGridPreviewWidget
      • ColorPaletteWidget
      • ITextModeCRTCameraSetupProvider
      • ScyllaTextModeConfigurationEditor
      • ScyllaTextModeDependencyProvider
      • ScyllaTextModeEditor
      • ScyllaTextModeMenuItems
      • ScyllaTextModeShaderProvider
      • TextModeCRTCameraSetup
      • TextModeCRTCameraStatus
      • TextModeCRTDriverEditor
      • TextModeCRTMonitorEditor
      • TextModeCRTPresetEditor
      • TextModeCRTPresetGenerator
      • TextModeColorAssetGenerator
      • TextModeColorPaletteDefaults
      • TextModeTerminalHostEditor
      • TextModeThemeField
      • TextModeViewEditor
      • TextModeViewEditorBase
      • UITextModeViewEditor
    • Scylla.TextMode.URP
      • CRTQualityTierParameter
      • TextModeCRTInjectionPoint
      • TextModeCRTPresetParameter
      • TextModeCRTRendererFeature
      • TextModeCRTVolume

    Class TextModeSelectionManager

    Manages click-drag text selection for a text mode grid view. Place this component alongside a TextModeView or UITextModeView and assign the view as the grid provider. Handles mouse input, applies Selected to affected cells, and provides text extraction and clipboard support.

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    TextModeSelectionManager
    Inherited Members
    MonoBehaviour.IsInvoking()
    MonoBehaviour.CancelInvoke()
    MonoBehaviour.Invoke(string, float)
    MonoBehaviour.InvokeRepeating(string, float, float)
    MonoBehaviour.CancelInvoke(string)
    MonoBehaviour.IsInvoking(string)
    MonoBehaviour.StartCoroutine(string)
    MonoBehaviour.StartCoroutine(string, object)
    MonoBehaviour.StartCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(Coroutine)
    MonoBehaviour.StopCoroutine(string)
    MonoBehaviour.StopAllCoroutines()
    MonoBehaviour.print(object)
    MonoBehaviour.destroyCancellationToken
    MonoBehaviour.useGUILayout
    MonoBehaviour.didStart
    MonoBehaviour.didAwake
    MonoBehaviour.runInEditMode
    Behaviour.enabled
    Behaviour.isActiveAndEnabled
    Component.GetComponent(Type)
    Component.GetComponent<T>()
    Component.TryGetComponent(Type, out Component)
    Component.TryGetComponent<T>(out T)
    Component.GetComponent(string)
    Component.GetComponentInChildren(Type, bool)
    Component.GetComponentInChildren(Type)
    Component.GetComponentInChildren<T>(bool)
    Component.GetComponentInChildren<T>()
    Component.GetComponentsInChildren(Type, bool)
    Component.GetComponentsInChildren(Type)
    Component.GetComponentsInChildren<T>(bool)
    Component.GetComponentsInChildren<T>(bool, List<T>)
    Component.GetComponentsInChildren<T>()
    Component.GetComponentsInChildren<T>(List<T>)
    Component.GetComponentInParent(Type, bool)
    Component.GetComponentInParent(Type)
    Component.GetComponentInParent<T>(bool)
    Component.GetComponentInParent<T>()
    Component.GetComponentsInParent(Type, bool)
    Component.GetComponentsInParent(Type)
    Component.GetComponentsInParent<T>(bool)
    Component.GetComponentsInParent<T>(bool, List<T>)
    Component.GetComponentsInParent<T>()
    Component.GetComponents(Type)
    Component.GetComponents(Type, List<Component>)
    Component.GetComponents<T>(List<T>)
    Component.GetComponents<T>()
    Component.GetComponentIndex()
    Component.CompareTag(string)
    Component.CompareTag(TagHandle)
    Component.SendMessageUpwards(string, object, SendMessageOptions)
    Component.SendMessageUpwards(string, object)
    Component.SendMessageUpwards(string)
    Component.SendMessageUpwards(string, SendMessageOptions)
    Component.SendMessage(string, object)
    Component.SendMessage(string)
    Component.SendMessage(string, object, SendMessageOptions)
    Component.SendMessage(string, SendMessageOptions)
    Component.BroadcastMessage(string, object, SendMessageOptions)
    Component.BroadcastMessage(string, object)
    Component.BroadcastMessage(string)
    Component.BroadcastMessage(string, SendMessageOptions)
    Component.transform
    Component.transformHandle
    Component.gameObject
    Component.tag
    Object.GetEntityId()
    Object.GetHashCode()
    Object.Equals(object)
    Object.InstantiateAsync<T>(T)
    Object.InstantiateAsync<T>(T, Transform)
    Object.InstantiateAsync<T>(T, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int)
    Object.InstantiateAsync<T>(T, int, Transform)
    Object.InstantiateAsync<T>(T, int, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.InstantiateAsync<T>(T, int, Transform, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int, Transform, Vector3, Quaternion, CancellationToken)
    Object.InstantiateAsync<T>(T, int, Transform, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.InstantiateAsync<T>(T, int, Transform, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>, CancellationToken)
    Object.InstantiateAsync<T>(T, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, int, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, Vector3, Quaternion, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, int, Vector3, Quaternion, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, int, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>, InstantiateParameters, CancellationToken)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Scene)
    Object.Instantiate<T>(T, InstantiateParameters)
    Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsByType(Type)
    Object.FindObjectsByType(Type, FindObjectsInactive)
    Object.DontDestroyOnLoad(Object)
    Object.FindAnyObjectByType<T>()
    Object.FindAnyObjectByType<T>(FindObjectsInactive)
    Object.FindObjectsByType<T>()
    Object.FindObjectsByType<T>(FindObjectsInactive)
    Object.FindAnyObjectByType(Type)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Scylla.TextMode
    Assembly: ScyllaTextMode.dll
    Syntax
    [AddComponentMenu("Scylla/TextMode/TextMode Selection Manager")]
    public class TextModeSelectionManager : MonoBehaviour

    Properties

    CopyShortcutEnabled

    Gets or sets whether Ctrl+C (Cmd+C on macOS) copies the selection. On by default. Turn it off when the host maps copying to its own input and calls CopyToClipboard().

    Declaration
    public bool CopyShortcutEnabled { get; set; }
    Property Value
    Type Description
    bool

    CurrentRange

    Gets the current selection range.

    Declaration
    public CellRange CurrentRange { get; }
    Property Value
    Type Description
    CellRange

    HasSelection

    Gets whether there is an active non-empty selection.

    Declaration
    public bool HasSelection { get; }
    Property Value
    Type Description
    bool

    InputEnabled

    Gets or sets whether mouse input is enabled for selection. When set to false, mouse input is ignored and any in-progress selection is cleared. Used by TextModeMouseReporter to suppress selection while mouse reporting is active.

    Side-effects when set to false: If a selection is active or in progress, the OnSelectionCleared delegate is invoked and a TextModeSelectionEndedEvent is published (if PublishEvents is true).

    Declaration
    public bool InputEnabled { get; set; }
    Property Value
    Type Description
    bool

    IsSelecting

    Gets whether a drag selection is currently in progress.

    Declaration
    public bool IsSelecting { get; }
    Property Value
    Type Description
    bool

    PinnedBottomRows

    Gets or sets how many rows at the bottom of the grid stay in place while the rest scrolls, such as a status line. A selection made above them is never drawn into them, so a selection moved by ShiftSelection(int) does not spill onto the status line. A selection made on them stays put when the rest shifts.

    Declaration
    public int PinnedBottomRows { get; set; }
    Property Value
    Type Description
    int

    PublishEvents

    Gets or sets whether to publish SEX events.

    Declaration
    public bool PublishEvents { get; set; }
    Property Value
    Type Description
    bool

    ViewProvider

    Gets or sets the view provider MonoBehaviour. Must implement ITextModeGridProvider. When set after OnEnable, the provider is re-resolved immediately.

    Declaration
    public MonoBehaviour ViewProvider { get; set; }
    Property Value
    Type Description
    MonoBehaviour

    Methods

    ClearSelection()

    Clears the current selection.

    Declaration
    public void ClearSelection()

    CopyToClipboard()

    Copies the selected text to the system clipboard.

    Declaration
    public void CopyToClipboard()

    GetSelectedText()

    Extracts the text content of the current selection. Trailing spaces on each row are trimmed, rows are separated by newlines.

    Declaration
    public string GetSelectedText()
    Returns
    Type Description
    string

    The selected text, or an empty string if no selection.

    RefreshSelectionVisuals()

    Re-applies the Selected attribute to all cells in the current selection range. Call this after any operation that overwrites grid cells (e.g. a full re-render) to restore the visual selection highlight.

    Declaration
    public void RefreshSelectionVisuals()

    SelectAll()

    Selects all cells in the grid.

    Declaration
    public void SelectAll()

    SelectRow(int)

    Selects all cells in the specified row.

    Declaration
    public void SelectRow(int row)
    Parameters
    Type Name Description
    int row

    Row index to select.

    SetInputEnabled(bool, bool)

    Turns mouse input for selection on or off, and decides whether a finished selection survives turning it off.

    Declaration
    public void SetInputEnabled(bool enabled, bool clearSelection)
    Parameters
    Type Name Description
    bool enabled

    Whether mouse input starts and extends selections.

    bool clearSelection

    Whether turning input off clears a finished selection.

    Remarks

    InputEnabled always clears the selection when input is turned off. This method can keep a finished selection instead, so it stays highlighted and can still be copied. TextModeMouseReporter uses this for a selection made with Shift held while an application has mouse reporting on. A drag that is still in progress is always cancelled, since it has no finished range to keep.

    SetSelection(CellRange)

    Sets the selection to the specified range programmatically.

    Declaration
    public void SetSelection(CellRange range)
    Parameters
    Type Name Description
    CellRange range

    The range to select.

    ShiftSelection(int)

    Moves the selection by a number of rows, so it stays on the same text when the view scrolls its content.

    Declaration
    public void ShiftSelection(int rows)
    Parameters
    Type Name Description
    int rows

    Rows to move. Positive moves the selection down.

    Remarks

    Call this right after the view scrolled, including when scrolling swapped the grid it shows, as a terminal does when it switches between its live screen and a view of its history. The swap is then taken as the same content moved, and the selection is kept instead of cleared. Parts of the selection that move out of view are kept too and are drawn again when they scroll back in. Copying takes only the visible part.

    Events

    OnSelectionChanged

    Invoked when the selection range changes during a drag. Parameter is the new range. May be null if no subscriber has registered.

    Declaration
    public event Action<CellRange> OnSelectionChanged
    Event Type
    Type Description
    Action<CellRange>

    OnSelectionCleared

    Invoked when the selection is cleared. May be null if no subscriber has registered.

    Declaration
    public event Action OnSelectionCleared
    Event Type
    Type Description
    Action

    OnSelectionEnded

    Invoked when a selection drag ends. Parameters are the final range and the selected text. May be null if no subscriber has registered.

    Declaration
    public event Action<CellRange, string> OnSelectionEnded
    Event Type
    Type Description
    Action<CellRange, string>

    OnSelectionStarted

    Invoked when a selection drag begins. Parameter is the initial range (anchor == active). May be null if no subscriber has registered.

    Declaration
    public event Action<CellRange> OnSelectionStarted
    Event Type
    Type Description
    Action<CellRange>
    In this article
    Back to top Scylla Framework - TextMode Module API Documentation