Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collection of differences between Rustdesks version and our version #167

Open
pentamassiv opened this issue Mar 29, 2023 · 4 comments
Open

Comments

@pentamassiv
Copy link
Collaborator

I am trying to analyze and list the differences between Rustdesks version (as of rustdesk/rustdesk@81bc362) and our version (commit 5bb84e9) so we can implement the missing features/fix bugs that they already fixed and maybe allow them to use our upstream version again to not duplicate the development effort.

Here is a list that I will continue to edit and probably open individual issues for:

They added a bunch of keys (I have yet to check if some/all of them were added by now on the master branch)

They marked a lot of the functions with #[inline] (https://matklad.github.io/2021/07/09/inline-in-rust.html)

Cargo.toml

They added hbb_common just to find out if the application runs under X11 or Wayland on Linux

let is_x11 = "x11" == hbb_common::platform::linux::get_display_server();

and they also use some of its types (I don't know why, we use the same types, but directly from libc)

use hbb_common::libc::{c_char, c_int, c_void, useconds_t};

They added log as a dependency

log = "0.4"

They added rdev as a dependency -> I still have to check what for

They added tfc as a dependency -> I still have to check what for

lib.rs

They also import this:

#[cfg(target_os = "windows")]
pub use win::ENIGO_INPUT_EXTRA_VALUE;

The mouse_down and key_down functions return a ResultType:

pub type ResultType = std::result::Result<(), Box<dyn std::error::Error>>;

They allow some casting and added it to the MouseControllable and KeyboardControllable traits:

    // https://stackoverflow.com/a/33687996
    /// Offer the ability to confer concrete type.
    fn as_any(&self) -> &dyn std::any::Any;

    /// Offer the ability to confer concrete type.
    fn as_mut_any(&mut self) -> &mut dyn std::any::Any;

They reverted the deprecation of keys

key_sequence_parse does not panic but prints an error if it fails

They added a fn to check the state of a key to the KeyboardControllable
fn get_key_state(&mut self, key: Key) -> bool;
And a test to see if it works

They added a dummy Enigo struct for Android and iOS, which does nothing?

linux.rs (they moved it to linux/xdo.rs

In each fn they first check if self.xdo is not NULL

if self.xdo.is_null() {
  return;
}

They added a fn to check the state of a key

They added as_any(&self) and as_mut_any functions

they added key_sequence_parse and key_sequence_parse_try to the KeyboardControllable impl of Enigo

@pentamassiv
Copy link
Collaborator Author

There are a few more files I haven't compared yet

@pentamassiv
Copy link
Collaborator Author

They added some special cases for shift + . on Italian keyboards (e.g rustdesk/rustdesk@7dfa038)

@pentamassiv
Copy link
Collaborator Author

pentamassiv commented Apr 19, 2024

They added the ability to get an LED state: rustdesk/rustdesk@72d357e

They added TFC to simulate input via uinput: https://github.com/indianakernick/The-Fat-Controller

They added rdev, but it looks like it is unused

They are using Pixels as the scroll unit when the touchpad was used on macOS (but they don't check if it was actually the touchpad. They assume it was when it was a horizontal scroll): rustdesk/rustdesk@260c924

They added as_any() methods: rustdesk/rustdesk@9dfa02a
It looks like the method is never used??

There can be sticky Fn keys on macOS and they added a workaround for it: rustdesk/rustdesk@01ade73#diff-964aff976dd9c54ee14fa883d75b78bd4fe601ce12c7a00633033fa26dc21ecf

VK_NUMLOCK, VK_DIVIDE, VK_RCONTROL, VK_RMENU, VK_SNAPSHOT are not considered Extended_keys on windows (rustdesk/rustdesk@c5e39f4)

They do something I haven't fully understood yet: rustdesk/rustdesk@ac74ed1

They do something with the Back and Forward mouse buttons on Windows: rustdesk/rustdesk@c4f9650#diff-8735351d4ec65cd079150df61bb6b77a650e4a8f746bfb2634593cdb6fc803ba

@Stankye
Copy link

Stankye commented May 18, 2024

They do something I haven't fully understood yet: rustdesk/rustdesk@ac74ed1

From looking over the code, I believe this started back at this commit rustdesk/rustdesk@3aebc43

I think this is to support Windows being able to use a different keyboard layouts per application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants