1
0
mirror of synced 2024-12-15 01:01:15 +01:00
ImHex/lib/third_party
Sten Feldman d70f7422b7
feat: Support Copy/Paste on WASM build outside the application border (#1542)
### Problem description
WASM build does not support copy/paste beyond the application. Meaning,
there's no practical way of sending text back and forth across the
application border.

There are lengthy threads why this is a technical challenge in
WASM/Browser world, e.g:
- https://github.com/pthom/hello_imgui/issues/3
- https://github.com/emscripten-core/emscripten/pull/19510

### Implementation description
Implements a workaround solution as Header only C++ library, as proposed
and implemented at:
https://github.com/Armchair-Software/emscripten-browser-clipboard

Maybe there are cleaner ways of achieving the functionality. Definitely
would like to have some discussion around this. 👀

ℹ️ The proposed PR "works for me" on Windows, using CTRL-C/V shortcuts
to copy text from and to the application. On MacOS the system shortcut
to Paste is different from what ImHex has defined. This results in
system Paste shortcut of command-V triggering the browser callback to
synchronise the application clipboard, but no actual Paste takes place
within ImHex.

If there would be a clean way to trigger the paste command, that would
be wonderful (or get the context and references to write the data to the
cursor, but I was unable to find a clean solution). The only proposed
solutions in the referenced threads were about triggering paste event
internally via Key events. This seemed wonky 🙃 , so is not currently
implemented. At the moment the paste on MacOS is command+V followed by
control+V.

### Additional things
This is definitely a stopgap solution before the ImGui and Emscripten
take a more proper solution in enabling Copy/Paste outside the
application borders. However, I feel like this is a must have capability
to make the WASM build more useful, not just for trying out ImHex.

Cheers! 🍻

---------

Co-authored-by: Nik <werwolv98@gmail.com>
2024-02-13 20:30:18 +01:00
..
capstone@097c04d941 build: move third party libraries to lib/third_party (#1417) 2023-11-12 02:02:54 +01:00
edlib@931be2b090 feat: Implement Myers' diffing algorithm (#1508) 2024-01-21 18:39:13 +01:00
fmt@e69e5f977d build: Updated libfmt 2024-01-06 09:36:53 +01:00
HashLibPlus@7609c542c9 build: Updated dependencies 2024-01-25 11:33:34 +01:00
imgui feat: Support Copy/Paste on WASM build outside the application border (#1542) 2024-02-13 20:30:18 +01:00
jthread build: move third party libraries to lib/third_party (#1417) 2023-11-12 02:02:54 +01:00
llvm-demangle build: move third party libraries to lib/third_party (#1417) 2023-11-12 02:02:54 +01:00
microtar build: move third party libraries to lib/third_party (#1417) 2023-11-12 02:02:54 +01:00
miniaudio build: move third party libraries to lib/third_party (#1417) 2023-11-12 02:02:54 +01:00
nativefiledialog@5786fabcee build: Updated nativefiledialog-extended 2023-11-25 19:32:53 +01:00
nlohmann_json build: Updated dependencies 2024-01-25 11:33:34 +01:00
xdgpp@f01f810714 build: move third party libraries to lib/third_party (#1417) 2023-11-12 02:02:54 +01:00
yara build: Fix various issues with linking, clang and unity builds 2024-01-29 22:57:39 +01:00