feat: linux support
This commit is contained in:
parent
04ebe3f606
commit
d996ca0efb
3 changed files with 80 additions and 1 deletions
|
@ -1,13 +1,32 @@
|
|||
#if OS_LINUX
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace ControllerSlidePresenter.InputSender;
|
||||
|
||||
public class LinuxInputSender : IInputSender {
|
||||
public void NextSlide() {
|
||||
private const string PageUp = "0xff55";
|
||||
private const string PageDown = "0xff56";
|
||||
|
||||
public void NextSlide() {
|
||||
SendKeys(PageDown);
|
||||
}
|
||||
|
||||
public void PreviousSlide() {
|
||||
SendKeys(PageUp);
|
||||
}
|
||||
|
||||
private static void SendKeys(string keycode) {
|
||||
Process proc = new() {
|
||||
StartInfo = {
|
||||
FileName = "xdotool",
|
||||
Arguments = $"key {keycode}",
|
||||
UseShellExecute = false,
|
||||
RedirectStandardError = false,
|
||||
RedirectStandardInput = false,
|
||||
RedirectStandardOutput = false
|
||||
}
|
||||
};
|
||||
proc.Start();
|
||||
}
|
||||
}
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue