mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-11 13:10:54 +00:00
Begin work on IME changes
This commit is contained in:
parent
73cd6b51d8
commit
18dc12218f
1 changed files with 16 additions and 0 deletions
|
@ -278,6 +278,18 @@ unsafe fn build_classes() {
|
||||||
|
|
||||||
pub struct Window(Rc<RefCell<WindowState>>);
|
pub struct Window(Rc<RefCell<WindowState>>);
|
||||||
|
|
||||||
|
///Used to track what the IME does when we send it a keystroke.
|
||||||
|
///This is only used to handle the case where the IME mysteriously
|
||||||
|
///swallows certain keys.
|
||||||
|
///
|
||||||
|
///Basically a direct copy of the approach that WezTerm uses in:
|
||||||
|
///github.com/wez/wezterm : d5755f3e : window/src/os/macos/window.rs
|
||||||
|
enum ImeState {
|
||||||
|
Continue,
|
||||||
|
Acted,
|
||||||
|
None,
|
||||||
|
}
|
||||||
|
|
||||||
struct WindowState {
|
struct WindowState {
|
||||||
id: usize,
|
id: usize,
|
||||||
native_window: id,
|
native_window: id,
|
||||||
|
@ -299,6 +311,10 @@ struct WindowState {
|
||||||
layer: id,
|
layer: id,
|
||||||
traffic_light_position: Option<Vector2F>,
|
traffic_light_position: Option<Vector2F>,
|
||||||
previous_modifiers_changed_event: Option<Event>,
|
previous_modifiers_changed_event: Option<Event>,
|
||||||
|
//State tracking what the IME did after the last request
|
||||||
|
ime_state: ImeState,
|
||||||
|
//Retains the last IME keystroke that was in the 'Acted' state
|
||||||
|
last_ime_key: Option<Keystroke>,
|
||||||
}
|
}
|
||||||
|
|
||||||
struct InsertText {
|
struct InsertText {
|
||||||
|
|
Loading…
Reference in a new issue