pub enum InputAction {
Show 31 variants
Clear,
NewLine,
LineStart,
LineEnd,
Left,
Right,
WordLeft,
WordRight,
Backspace,
Delete,
DeleteWordBefore,
DeleteWordAfter,
DeleteToLineStart,
DeleteToLineEnd,
LineUp,
LineDown,
Up,
Down,
ScrollUp,
ScrollDown,
PageUp,
PageDown,
Tab,
Send,
Stop,
PasteImage,
SelectUp,
SelectDown,
Deselect,
AnswerInline(u8),
DismissInline,
}Expand description
A built-in action of the input. On a KeyBinding’s entity it is what
the binding does, in order with the other keys of the frame, instead of
triggering KeyPressed: the view’s own keys are such bindings, and a
plugin rebinds one by spawning its own. Pushed onto the
PendingInput as
KeyInput::Action, it is done where it
stands among the keys.
use rig_harness::prelude::*;
use rig_tui::{InputAction, KeyBinding, KeyPress};
fn build(app: &mut App) {
// Ctrl+K browses back as Up does: the completion, the line, the history.
app.world_mut().spawn((KeyBinding::new(KeyPress::ctrl('k'), "Up"), InputAction::Up));
}Variants§
Clear
Empties the input.
NewLine
Types a newline.
LineStart
The start of the cursor’s line.
LineEnd
The end of the cursor’s line.
Left
A character back.
Right
A character forward.
WordLeft
The start of the word before the cursor.
WordRight
The end of the word after the cursor.
Backspace
Deletes the character before the cursor.
Delete
Deletes the character after the cursor.
DeleteWordBefore
Deletes the word before the cursor.
DeleteWordAfter
Deletes the word after the cursor.
DeleteToLineStart
Deletes to the start of the line, or the newline before it.
DeleteToLineEnd
Deletes to the end of the line, or the newline after it.
LineUp
The line above, or an earlier prompt of the history: Ctrl+P.
LineDown
The line below, or a later prompt of the history: Ctrl+N.
Up
The completion’s previous item, else the line above, else an earlier prompt.
Down
The completion’s next item, else the line below, else a later prompt.
ScrollUp
Scrolls the transcript a row up.
ScrollDown
Scrolls the transcript a row down.
PageUp
Scrolls the transcript a page up.
PageDown
Scrolls the transcript a page down.
Tab
Completes, or with a turn running and nothing to complete, sends for after the turn.
Send
Completes a partly typed command or path, continues a line ending
in \, else sends.
Stop
Closes the completion, else interrupts the shown agent.
PasteImage
Saves the clipboard’s image in the session’s
Scratch::images and types
@path for it, which attaches it to the message, or says there is
none. A pasted path to an image file (a file dropped on the
terminal) becomes @path too.
SelectUp
Selects the item of the transcript above the one selected, or the newest.
SelectDown
Selects the item below the one selected; past the newest, none.
Deselect
Selects none, which gives the keys back to the input: Esc while
the person reads the transcript (KeyScope::Transcript).
AnswerInline(u8)
Answers the question shown beside the work with its choice of this number, counted from 1, or the number after its choices: types its answer in the input.
DismissInline
Closes the question shown beside the work, refused.
Trait Implementations§
Source§impl Clone for InputAction
impl Clone for InputAction
Source§impl Component for InputAction
impl Component for InputAction
Source§const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::Table
const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::Table
Source§type Mutability = Mutable
type Mutability = Mutable
Component<Mutability = Mutable>,
while immutable components will instead have Component<Mutability = Immutable>. Read moreSource§fn register_required_components(
_requiree: ComponentId,
required_components: &mut RequiredComponentsRegistrator<'_, '_>,
)
fn register_required_components( _requiree: ComponentId, required_components: &mut RequiredComponentsRegistrator<'_, '_>, )
Source§fn clone_behavior() -> ComponentCloneBehavior
fn clone_behavior() -> ComponentCloneBehavior
Source§fn map_entities<M: EntityMapper>(this: &mut Self, mapper: &mut M)
fn map_entities<M: EntityMapper>(this: &mut Self, mapper: &mut M)
EntityMapper. This is used to remap entities in contexts like scenes and entity cloning.
When deriving Component, this is populated by annotating fields containing entities with #[entities] Read moreSource§fn relationship_accessor() -> Option<ComponentRelationshipAccessor<Self>>
fn relationship_accessor() -> Option<ComponentRelationshipAccessor<Self>>
ComponentRelationshipAccessor required for working with relationships in dynamic contexts. Read moreSource§fn on_add() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_add() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_insert() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_insert() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_discard() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_discard() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_remove() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_remove() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§const HAS_SUMMARY_TICK: bool = false
const HAS_SUMMARY_TICK: bool = false
impl Copy for InputAction
Source§impl Debug for InputAction
impl Debug for InputAction
impl Eq for InputAction
Source§impl PartialEq for InputAction
impl PartialEq for InputAction
impl StructuralPartialEq for InputAction
Auto Trait Implementations§
impl Freeze for InputAction
impl RefUnwindSafe for InputAction
impl Send for InputAction
impl Sync for InputAction
impl Unpin for InputAction
impl UnsafeUnpin for InputAction
impl UnwindSafe for InputAction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<C> Bundle for Cwhere
C: Component,
impl<C> Bundle for Cwhere
C: Component,
fn component_ids( components: &mut ComponentsRegistrator<'_>, ) -> impl Iterator<Item = ComponentId> + use<C>
Source§fn get_component_ids(
components: &Components,
) -> impl Iterator<Item = Option<ComponentId>>
fn get_component_ids( components: &Components, ) -> impl Iterator<Item = Option<ComponentId>>
Source§impl<C> BundleFromComponents for Cwhere
C: Component,
impl<C> BundleFromComponents for Cwhere
C: Component,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ConditionalSend for Twhere
T: Send,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<C> DynamicBundle for Cwhere
C: Component,
impl<C> DynamicBundle for Cwhere
C: Component,
Source§unsafe fn get_components(
ptr: MovingPtr<'_, C>,
func: &mut impl FnMut(StorageType, OwningPtr<'_>),
) -> <C as DynamicBundle>::Effect
unsafe fn get_components( ptr: MovingPtr<'_, C>, func: &mut impl FnMut(StorageType, OwningPtr<'_>), ) -> <C as DynamicBundle>::Effect
Source§unsafe fn apply_effect(
_ptr: MovingPtr<'_, MaybeUninit<C>>,
_entity: &mut EntityWorldMut<'_>,
)
unsafe fn apply_effect( _ptr: MovingPtr<'_, MaybeUninit<C>>, _entity: &mut EntityWorldMut<'_>, )
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> Template for T
impl<T> Template for T
Source§fn build_template(
&self,
_context: &mut TemplateContext<'_, '_>,
) -> Result<<T as Template>::Output, BevyError>
fn build_template( &self, _context: &mut TemplateContext<'_, '_>, ) -> Result<<T as Template>::Output, BevyError>
entity context to produce a Template::Output.Source§fn clone_template(&self) -> T
fn clone_template(&self) -> T
Clone.Source§impl<T> TypeData for T
impl<T> TypeData for T
Source§fn clone_type_data(&self) -> Box<dyn TypeData>
fn clone_type_data(&self) -> Box<dyn TypeData>
self.