Skip to main content

KeyboardAction

Enum KeyboardAction 

Source
#[non_exhaustive]
pub enum KeyboardAction {
Show 57 variants PanLeftFast, PanRightFast, Undo, Redo, OpenQuickSearch, OpenIntervalSearch, GoToDate, Snapshot, InvertScale, CopyDrawing, PasteDrawing, ToggleDrawings, MaximizeChart, CompleteDrawing, DrawingTool(DrawingToolType), PanLeft, PanRight, PanUp, PanDown, ZoomIn, ZoomOut, PageUp, PageDown, ScrollToRealTime, ScrollToFirstBar, FitContent, ResetZoom, ResetChart, ToggleAutoScale, ToggleLogScale, TogglePercentageScale, ToggleCrosshair, ToggleGrid, ToggleVolume, CycleChartType, ToggleDrawingMode, DeleteSelectedDrawing, Cancel, SetTimeframe1Min, SetTimeframe5Min, SetTimeframe15Min, SetTimeframe30Min, SetTimeframe1Hour, SetTimeframe4Hour, SetTimeframeDaily, SetTimeframeWeekly, SetTimeframeMonthly, CreateAlert, OpenIndicatorSearch, OpenSymbolSearch, SaveLayout, OpenLayout, OpenDataWindow, ToggleSession, ShowKeyboardHelp, CycleChartFocus, CycleChartFocusBack,
}
Expand description

Keyboard actions that can be performed on the chart

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

PanLeftFast

Pan left by a page.

§

PanRightFast

Pan right by a page.

§

Undo

Undo the last edit.

§

Redo

Redo the last undone edit.

§

OpenQuickSearch

Open quick search.

§

OpenIntervalSearch

Open interval entry.

§

GoToDate

Go to a date.

§

Snapshot

Take a chart snapshot.

§

InvertScale

Invert the price scale.

§

CopyDrawing

Copy the selected drawing.

§

PasteDrawing

Paste a copied drawing.

§

ToggleDrawings

Hide or show drawings.

§

MaximizeChart

Maximize the active chart.

§

CompleteDrawing

Complete a multi-point drawing.

§

DrawingTool(DrawingToolType)

Select a drawing tool. A horizontal, vertical or cross line is placed at once at the pointer when the pointer is over the chart.

§

PanLeft

Pan left (Left arrow)

§

PanRight

Pan right (Right arrow)

§

PanUp

Pan up in the price scale

§

PanDown

Pan down in the price scale

§

ZoomIn

Zoom in (+, =)

§

ZoomOut

Zoom out (-, _)

§

PageUp

Page up (zoom in more)

§

PageDown

Page down (zoom out more)

§

ScrollToRealTime

Scroll to real-time / latest data (Alt+Shift+Right, End)

§

ScrollToFirstBar

Scroll the oldest bar to the left edge, keeping the zoom (Alt+Shift+Left, Home)

§

FitContent

Fit content to visible range

§

ResetZoom

Reset zoom to default

§

ResetChart

Reset chart (includes zoom and pan) (Alt+R)

§

ToggleAutoScale

Toggle auto-scale

§

ToggleLogScale

Toggle logarithmic scale

§

TogglePercentageScale

Toggle percentage scale

§

ToggleCrosshair

Toggle crosshair

§

ToggleGrid

Toggle grid

§

ToggleVolume

Toggle volume

§

CycleChartType

Cycle through chart types

§

ToggleDrawingMode

Enable/disable drawing mode

§

DeleteSelectedDrawing

Delete the selected drawings, or the selected study when no drawing is selected (Delete, Backspace)

§

Cancel

Escape/cancel current action (Escape)

§

SetTimeframe1Min

1-minute timeframe

§

SetTimeframe5Min

5-minute timeframe

§

SetTimeframe15Min

15-minute timeframe

§

SetTimeframe30Min

30-minute timeframe

§

SetTimeframe1Hour

1-hour timeframe

§

SetTimeframe4Hour

4-hour timeframe

§

SetTimeframeDaily

Daily timeframe

§

SetTimeframeWeekly

Weekly timeframe

§

SetTimeframeMonthly

Monthly timeframe

§

CreateAlert

Create alert (Alt+A)

§

OpenIndicatorSearch

Open indicator search (/)

§

OpenSymbolSearch

Open symbol search

§

SaveLayout

Save layout

§

OpenLayout

Open a saved layout (.)

§

OpenDataWindow

Show the data window (Alt+D)

§

ToggleSession

Switch between the regular and extended trading sessions (Alt+Shift+E)

§

ShowKeyboardHelp

Show keyboard shortcuts help (?)

§

CycleChartFocus

Cycle focus to next chart (Tab)

§

CycleChartFocusBack

Cycle focus to previous chart (Shift+Tab)

Implementations§

Source§

impl KeyboardAction

Source

pub fn from_key_press_with_modifiers(input: &InputState) -> Option<Self>

Scan all key presses in the current input state and return the first matching action.

Source

pub fn from_key_press(key: Key, modifiers: &Modifiers) -> Option<Self>

Map egui key press to keyboard action Returns None if the key is not mapped

Source

pub fn desc(&self) -> &str

Human-readable description of the action. Use shortcuts for its bound keys.

Source

pub fn label(&self) -> &str

Human-readable label for the action (used in shortcuts dialog)

Source

pub fn shortcuts(&self) -> &'static [KeyboardShortcut]

The key combinations for this action, the first of which menus show. Empty for the actions the shortcuts dialog and the menus do not show.

Source

pub fn shortcut(&self) -> Option<KeyboardShortcut>

The first of shortcuts, for menus to show with [egui::Context::format_shortcut].

Source

pub fn shortcut_key(&self) -> &'static str

Short display text for default bindings. Menus format shortcuts for the platform.

Source

pub fn all_by_category() -> Vec<(&'static str, Vec<KeyboardAction>)>

The actions with a bound key, grouped by category (for the shortcuts dialog).

Trait Implementations§

Source§

impl Clone for KeyboardAction

Source§

fn clone(&self) -> KeyboardAction

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for KeyboardAction

Source§

impl Debug for KeyboardAction

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for KeyboardAction

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for KeyboardAction

Source§

impl PartialEq for KeyboardAction

Source§

fn eq(&self, other: &KeyboardAction) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for KeyboardAction

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> MaybeSend for T
where T: Send + Sync + ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

§

impl<T> SerializableAny for T
where T: 'static + Any + Clone + for<'a> Send + Sync,

§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

§

fn simd_from(_simd: S, value: T) -> T

§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

§

fn simd_into(self, simd: S) -> T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.