Send TextInputEvent

parent ff7c058d
Pipeline #8591 passed with stage
in 1 minute and 9 seconds
This diff is collapsed.
......@@ -18,3 +18,6 @@ toml = "0.3"
[dependencies.orbital-core]
path = "orbital-core"
[patch.crates-io]
orbclient = { git = "https://gitlab.redox-os.org/redox-os/orbclient.git", branch = "text-input" }
......@@ -13,4 +13,5 @@ orbimage = "0.1"
redox_syscall = "0.1"
[dependencies.redox_event]
git = "https://github.com/redox-os/event.git"
git = "https://gitlab.redox-os.org/redox-os/event.git"
rev = "c31e3d3d5f44d60ff9fec2b1ee58b982e72c0d77"
......@@ -32,7 +32,7 @@ use syscall::{
flag::{O_CLOEXEC, O_CREAT, O_NONBLOCK, O_RDWR}
};
const CLIPBOARD_FLAG: usize = (1 << 63);
const CLIPBOARD_FLAG: usize = 1 << 63;
#[derive(Debug, Fail)]
pub enum Error {
......@@ -348,7 +348,7 @@ pub struct OrbitalHandler<H: Handler> {
}
impl<H: Handler> SchemeMut for OrbitalHandler<H> {
fn open(&mut self, path: &[u8], _: usize, _: u32, _: u32) -> syscall::Result<usize> {
let path = try!(str::from_utf8(path).or(Err(syscall::Error::new(EINVAL))));
let path = str::from_utf8(path).or(Err(syscall::Error::new(EINVAL)))?;
let mut parts = path.split("/");
let flags = parts.next().unwrap_or("");
......
use orbclient::{
self, Color, Event, EventOption, KeyEvent, MouseEvent, MouseRelativeEvent, ButtonEvent,
ClipboardEvent, FocusEvent, QuitEvent, MoveEvent, ResizeEvent, ScreenEvent, Renderer
ClipboardEvent, FocusEvent, QuitEvent, MoveEvent, ResizeEvent, ScreenEvent, Renderer,
TextInputEvent,
};
use orbfont;
use syscall;
......@@ -573,6 +574,12 @@ impl<'a> OrbitalSchemeEvent<'a> {
}
} else if let Some(id) = self.scheme.order.front() {
if let Some(window) = self.scheme.windows.get_mut(&id) {
if event.pressed && event.character != '\0' {
let text_input_event = TextInputEvent {
character: event.character,
}.to_event();
window.event(text_input_event);
}
window.event(event.to_event());
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment