Skip to content
Snippets Groups Projects
Verified Commit c9baae7b authored by Louis's avatar Louis :fire:
Browse files

Add feature flag for clipboard access

parent e4c7dc14
No related tags found
No related merge requests found
...@@ -11,8 +11,10 @@ keywords = ["bevy"] ...@@ -11,8 +11,10 @@ keywords = ["bevy"]
exclude = ["assets/*"] exclude = ["assets/*"]
[features] [features]
default_features = ["clipboard"]
## For internal use only ## For internal use only
internal-debugging = ["bevy/track_change_detection"] internal-debugging = ["bevy/track_change_detection"]
clipboard = ["dep:arboard"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
...@@ -39,7 +41,7 @@ sys-locale = "0.3.0" ...@@ -39,7 +41,7 @@ sys-locale = "0.3.0"
document-features = "0.2.8" document-features = "0.2.8"
[target.'cfg(not(target_arch = "wasm32"))'.dependencies] [target.'cfg(not(target_arch = "wasm32"))'.dependencies]
arboard = "3.2.0" arboard = { version = "3.2.0", optional = true }
[target.'cfg(target_arch = "wasm32")'.dependencies] [target.'cfg(target_arch = "wasm32")'.dependencies]
js-sys = "0.3.70" js-sys = "0.3.70"
......
...@@ -54,7 +54,7 @@ pub(crate) fn kb_clipboard( ...@@ -54,7 +54,7 @@ pub(crate) fn kb_clipboard(
let readonly = readonly_opt.is_some(); let readonly = readonly_opt.is_some();
let mut is_clipboard = false; let mut is_clipboard = false;
#[cfg(not(target_arch = "wasm32"))] #[cfg(all(feature = "clipboard", not(target_arch = "wasm32")))]
{ {
if let Ok(mut clipboard) = arboard::Clipboard::new() { if let Ok(mut clipboard) = arboard::Clipboard::new() {
if command && keys.just_pressed(KeyCode::KeyC) { if command && keys.just_pressed(KeyCode::KeyC) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment