diff --git a/src/compositor.rs b/src/compositor.rs index c03cd209..efcf7de6 100644 --- a/src/compositor.rs +++ b/src/compositor.rs @@ -28,10 +28,16 @@ use servo_geometry::{DeviceIndependentIntSize, DeviceIndependentPixel}; use style_traits::{CSSPixel, PinchZoomFactor}; use webrender::{RenderApi, Transaction}; use webrender_api::units::{ - DeviceIntPoint, DeviceIntRect, DeviceIntSize, DevicePixel, DevicePoint, LayoutPoint, LayoutRect, LayoutSize, LayoutVector2D, WorldPoint + DeviceIntPoint, DeviceIntRect, DeviceIntSize, DevicePixel, DevicePoint, LayoutPoint, + LayoutRect, LayoutSize, LayoutVector2D, WorldPoint, }; use webrender_api::{ - BorderRadius, BoxShadowClipMode, BuiltDisplayList, ClipMode, ColorF, CommonItemProperties, ComplexClipRegion, DirtyRect, DisplayListPayload, DocumentId, Epoch as WebRenderEpoch, ExternalScrollId, FontInstanceFlags, FontInstanceKey, FontInstanceOptions, FontKey, HitTestFlags, PipelineId as WebRenderPipelineId, PropertyBinding, ReferenceFrameKind, RenderReasons, SampledScrollOffset, ScrollLocation, SpaceAndClipInfo, SpatialId, SpatialTreeItemKey, TransformStyle + BorderRadius, BoxShadowClipMode, BuiltDisplayList, ClipMode, ColorF, CommonItemProperties, + ComplexClipRegion, DirtyRect, DisplayListPayload, DocumentId, Epoch as WebRenderEpoch, + ExternalScrollId, FontInstanceFlags, FontInstanceKey, FontInstanceOptions, FontKey, + HitTestFlags, PipelineId as WebRenderPipelineId, PropertyBinding, ReferenceFrameKind, + RenderReasons, SampledScrollOffset, ScrollLocation, SpaceAndClipInfo, SpatialId, + SpatialTreeItemKey, TransformStyle, }; use webrender_traits::display_list::{HitTestInfo, ScrollTree}; use webrender_traits::{ diff --git a/src/keyboard.rs b/src/keyboard.rs index f3036c29..3ca58154 100644 --- a/src/keyboard.rs +++ b/src/keyboard.rs @@ -33,15 +33,15 @@ pub const CMD_OR_ALT: Modifiers = Modifiers::ALT; /// matches [`NamedKey::Escape`] => [`Key::Escape`], [`NamedKey::F1`] => [`Key::F2`], [`NamedKey::F3`] => [`Key::F3`],... macro_rules! logical_to_winit_key { // Matches an optional token - (@opt $_: ident, $optional: ident) => { - Key::$optional + (@opt $_: ident, $optional: expr) => { + $optional }; (@opt $variant: ident) => { Key::$variant }; - ($key: ident $(,$variant: ident $(=> $matchto: ident)?)+) => { + ($key: ident $(,$variant: ident $(=> $matchto: expr)?)+) => { match $key { LogicalKey::Character(c) => Key::Character(c.to_string()), $(LogicalKey::Named(NamedKey::$variant) => logical_to_winit_key!(@opt $variant $(, $matchto)?),)+ @@ -64,7 +64,6 @@ fn get_servo_key_from_winit_key(key: &LogicalKey) -> Key { Pause, Insert, Home, Delete, End, PageDown, PageUp, ArrowLeft, ArrowUp, ArrowRight, ArrowDown, Backspace, Enter, - // printable: Space Compose, // Caret not mapped NumLock, @@ -104,7 +103,8 @@ fn get_servo_key_from_winit_key(key: &LogicalKey) -> Key { // printable Yen, Copy, Paste, - Cut + Cut, + Space => Key::Character(" ".to_string()) } }