diff --git a/.changes/global-shortcut-mod-location.md b/.changes/global-shortcut-mod-location.md new file mode 100644 index 000000000..d4bf38cee --- /dev/null +++ b/.changes/global-shortcut-mod-location.md @@ -0,0 +1,5 @@ +--- +"tao": minor +--- + +Move `global_shortcut` mod to the lib root. \ No newline at end of file diff --git a/examples/global_shortcut.rs b/examples/global_shortcut.rs index cf956afed..029dfe1d3 100644 --- a/examples/global_shortcut.rs +++ b/examples/global_shortcut.rs @@ -9,8 +9,8 @@ fn main() { accelerator::{Accelerator, AcceleratorId, RawMods, SysMods}, event::{Event, WindowEvent}, event_loop::{ControlFlow, EventLoop}, + global_shortcut::ShortcutManager, keyboard::KeyCode, - platform::global_shortcut::ShortcutManager, window::WindowBuilder, }; diff --git a/src/platform/global_shortcut.rs b/src/global_shortcut.rs similarity index 100% rename from src/platform/global_shortcut.rs rename to src/global_shortcut.rs diff --git a/src/lib.rs b/src/lib.rs index 2e309b96b..ec825c57f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -165,6 +165,7 @@ pub mod error; pub mod accelerator; pub mod event; pub mod event_loop; +pub mod global_shortcut; mod icon; pub mod keyboard; pub mod menu; diff --git a/src/platform/mod.rs b/src/platform/mod.rs index 9f4f630ca..651c986ea 100644 --- a/src/platform/mod.rs +++ b/src/platform/mod.rs @@ -19,7 +19,6 @@ //! However only the module corresponding to the platform you're compiling to will be available. pub mod android; -pub mod global_shortcut; pub mod ios; pub mod macos; pub mod run_return; diff --git a/src/platform_impl/linux/global_shortcut.rs b/src/platform_impl/linux/global_shortcut.rs index a74b9ec85..68d1fb43d 100644 --- a/src/platform_impl/linux/global_shortcut.rs +++ b/src/platform_impl/linux/global_shortcut.rs @@ -2,8 +2,8 @@ use super::window::{WindowId, WindowRequest}; use crate::{ accelerator::{Accelerator, AcceleratorId}, event_loop::EventLoopWindowTarget, + global_shortcut::{GlobalShortcut as RootGlobalShortcut, ShortcutManagerError}, keyboard::KeyCode, - platform::global_shortcut::{GlobalShortcut as RootGlobalShortcut, ShortcutManagerError}, }; use std::{ collections::HashMap, diff --git a/src/platform_impl/macos/global_shortcut.rs b/src/platform_impl/macos/global_shortcut.rs index 08abfd818..c9ae240bc 100644 --- a/src/platform_impl/macos/global_shortcut.rs +++ b/src/platform_impl/macos/global_shortcut.rs @@ -4,7 +4,7 @@ use crate::{ accelerator::{Accelerator, AcceleratorId}, event::Event, event_loop::EventLoopWindowTarget, - platform::global_shortcut::{GlobalShortcut as RootGlobalShortcut, ShortcutManagerError}, + global_shortcut::{GlobalShortcut as RootGlobalShortcut, ShortcutManagerError}, }; use super::{app_state::AppState, event::EventWrapper}; diff --git a/src/platform_impl/windows/global_shortcut.rs b/src/platform_impl/windows/global_shortcut.rs index 4a3e285da..16aedc26e 100644 --- a/src/platform_impl/windows/global_shortcut.rs +++ b/src/platform_impl/windows/global_shortcut.rs @@ -2,8 +2,8 @@ use super::keyboard::key_to_vk; use crate::{ accelerator::{Accelerator, AcceleratorId}, event_loop::EventLoopWindowTarget, + global_shortcut::{GlobalShortcut as RootGlobalShortcut, ShortcutManagerError}, keyboard::ModifiersState, - platform::global_shortcut::{GlobalShortcut as RootGlobalShortcut, ShortcutManagerError}, }; use std::ptr; use winapi::{shared::windef::HWND, um::winuser};