Skip to content

Commit

Permalink
Add flags to support other unix systems. (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ngo Iok Ui (Wu Yu Wei) authored Jul 20, 2021
1 parent 91a4d26 commit 546f51a
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .changes/unix-support.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"tao": patch
---

Add flags to support all other possible unix systems.

8 changes: 7 additions & 1 deletion src/clipboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@ impl ClipboardFormat {
pub const TEXT: &'static str = "public.utf8-plain-text";
#[cfg(any(target_os = "windows", target_os = "android"))]
pub const TEXT: &'static str = "text/plain";
#[cfg(target_os = "linux")]
#[cfg(any(
target_os = "linux",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "netbsd",
target_os = "openbsd"
))]
pub const TEXT: &'static str = "UTF8_STRING";
}

Expand Down
4 changes: 2 additions & 2 deletions src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ pub struct KeyEvent {
pub(crate) platform_specific: platform_impl::KeyEventExtra,
}

#[cfg(any(target_os = "windows", target_os = "linux", target_os = "macos"))]
#[cfg(not(any(target_os = "android", target_os = "ios")))]
impl KeyEvent {
/// Identical to `KeyEvent::text` but this is affected by <kbd>Ctrl</kbd>.
///
Expand All @@ -798,7 +798,7 @@ impl KeyEvent {
}
}

#[cfg(not(any(target_os = "windows", target_os = "linux", target_os = "macos")))]
#[cfg(any(target_os = "android", target_os = "ios"))]
impl KeyEvent {
/// Identical to `KeyEvent::text`.
pub fn text_with_all_modifiers(&self) -> Option<&str> {
Expand Down
10 changes: 9 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,15 @@ pub mod keyboard;
pub mod menu;
pub mod monitor;
mod platform_impl;
#[cfg(any(target_os = "windows", target_os = "linux", target_os = "macos"))]
#[cfg(any(
target_os = "windows",
target_os = "macos",
target_os = "linux",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "netbsd",
target_os = "openbsd"
))]
#[cfg(feature = "tray")]
pub mod system_tray;
pub mod window;
Expand Down

0 comments on commit 546f51a

Please sign in to comment.