Rust 想做一个超级简单的远程

想使用 rust 做一个简单的桌面远程,用在内网,客户端和被控端直连,现在问题是不知道rust桌面捕捉屏幕、不晓得怎么模拟鼠标键盘事件、还有一个问题是需要兼容win7 的电脑。

You can refer to this part of RustDesk's code rustdesk/libs/scrap at master - rustdesk/rustdesk (github.com) and this part rustdesk/libs/enigo/src/win/win_impl.rs at master - rustdesk/rustdesk (github.com)

The simulation of mouse events is actually quite simple: intercept mouse and keyboard events, send them to the remote end and call SendInput, but there are quite a few keyboard details that need to be handled.

Hi and welcome! The discussions in this forum typically are in English. If you don't speak English, perhaps you can still get by with translation tools and/or by asking a friend to help out with translating.

Having your post machine-translated gives me:

I want to use Rust to create a simple desktop remote for use within an intranet. The client and the controlled end will be directly connected. The current issue is that I don't know how Rust captures the desktop screen, I'm not sure how to simulate mouse and keyboard events, and another issue is the need to be compatible with computers running Windows 7.

On that note, this forum is the "internals" forum, for discussing the design and implementation of the Rust language and standard library. Your question would fit the users.rust-lang.org forum better (that forum would also be in English).

7 Likes

I recall that there is also a separate Chinese users' forum, although I don't know its domain name.

However, are you sure posts in URLO really are required to be in English? The stickied rules topic doesn't say that, and neither does the section about URLO in https://www.rust-lang.org/zh-CN/community.

I’m not actually so sure. One time the question came up, e.g. here, it sounded like there’s probably actually no rule against using other languages. Thus, excuse my previous statement if it sounded too absolute… it’s still true, of course, that English is the best language to use if you want to get your question answered quickly :slight_smile:

It also makes the job easier for moderation (if anything gets flagged, it helps if one can understand what’s said) and it makes topics more generally useful after the fact, since more people will be able to understand what was asked and what the answer was. (In this last argument, I’m not saying there’s more people in the world that understand English than Chinese, but that there’s more such people in a typically-English-speaking forum such as URLO. Yet, that’s a bit of a self-reinforcing cycle.)

Thank you for your suggestion. I have checked trustdesk/libs/track on master trustdesk/trustdesk (github. com) and now my code has been submitted to https://github.com/chenyuxingkong/rust-remote-desktop/blob/master/src/main.rs,Please correct it.

Sorry, my English is not very good. I want to create a very simple remote desktop application, P2P

After checking your repo, idk how to give you more detail advices since it's seems that you're not familiar of some basic knowlege about GUI system. There are so many free (even open source) solutions like RustDesk,AnyDesk, TeamViewer, or RDP. Why not choose one instead of starting from nothing?

rustcc.cn

Maybe it’s just a straightforward translation to the English page? Seems that more Chinese resources about Rust can be considered to add to the page, e.g. rustwiki.org that provides Chinese translation of Rust docs including TRPL, RBE, the reference, the Cargo book and even libstd doc (I’m not sure how they do this).

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.