Skip to content

Commit 5fa7e52

Browse files
committed
Adding edge remote
1 parent b38cb33 commit 5fa7e52

File tree

7 files changed

+276
-0
lines changed

7 files changed

+276
-0
lines changed

Main/Edge/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Edge
2+
Easily control your Edge browser window from a distance. If you're trying to browse the web from your sofa at a distance then this remotes makes it easier to do the right thing (rather than trying to move the mouse).
3+
4+
## Features
5+
* Navigation (back, forward, home)
6+
* Tabs (open, close, next, previous)
7+
* Find on current page
8+
* Refresh current page
9+
* Scroll up/down
10+
* Zoom in/out
11+
* Focus URL field
12+
13+
## Support
14+
Developed and maintained by **Unified Remote**
15+
https://www.unifiedremote.com/help

Main/Edge/icon.png

7.19 KB
Loading

Main/Edge/icon_hires.png

19 KB
Loading

Main/Edge/layout.xml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<layout onLaunch="launch" onVolumeUp="scroll_up" onVolumeDown="scroll_down" color="#5fc0d4">
3+
<grid>
4+
<row>
5+
<button icon="left" onTap="back" />
6+
<button icon="docclose" onTap="close_tab" />
7+
<button icon="right" onTap="forward" />
8+
</row>
9+
<row>
10+
<button icon="docleft" onTap="previous_tab" />
11+
<button icon="docnew" onTap="new_tab" />
12+
<button icon="docright" onTap="next_tab" />
13+
</row>
14+
<row>
15+
<button icon="web" onTap="address" />
16+
<button icon="home" onTap="home" />
17+
<button icon="search" onTap="find" />
18+
</row>
19+
<row>
20+
<button icon="zoomout" onTap="zoom_out" />
21+
<button icon="zoomnormal" onTap="zoom_normal" />
22+
<button icon="zoomin" onTap="zoom_in" />
23+
</row>
24+
<row>
25+
<button icon="down" onTap="scroll_down" />
26+
<button icon="refresh" onTap="refresh" />
27+
<button icon="up" onTap="scroll_up" />
28+
</row>
29+
</grid>
30+
</layout>

Main/Edge/meta.prop

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
meta.name: Edge
2+
meta.author: Unified
3+
meta.description: Microsoft Edge browser remote.
4+
meta.tags.category: browser

Main/Edge/remote.lua

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
local keyboard = libs.keyboard;
2+
local win = libs.win;
3+
local device = libs.device;
4+
5+
events.detect = function ()
6+
return libs.fs.exists("C:\\Program Files (x86)\\Microsoft\\Edge\\Application");
7+
end
8+
9+
--@help Focus Edge application
10+
actions.switch = function()
11+
if OS_WINDOWS then
12+
local hwnd = win.window("msedge.exe");
13+
if (hwnd == 0) then actions.launch(); end
14+
win.switchtowait("msedge.exe");
15+
end
16+
end
17+
18+
--@help Launch Edge application
19+
actions.launch = function()
20+
if OS_WINDOWS then
21+
os.start("msedge");
22+
end
23+
end
24+
25+
--@help Naviagte back
26+
actions.back = function()
27+
actions.switch();
28+
keyboard.stroke("menu", "left");
29+
end
30+
31+
--@help Close current tab
32+
actions.close_tab = function()
33+
actions.switch();
34+
keyboard.stroke("control", "W");
35+
end
36+
37+
--@help Navigate forward
38+
actions.forward = function()
39+
actions.switch();
40+
keyboard.stroke("menu", "right");
41+
end
42+
43+
--@help Go to next tab
44+
actions.next_tab = function()
45+
actions.switch();
46+
keyboard.stroke("control", "tab");
47+
end
48+
49+
--@help Go to previous tab
50+
actions.previous_tab = function()
51+
actions.switch();
52+
keyboard.stroke("control", "shift", "tab");
53+
end
54+
55+
--@help Open new tab
56+
actions.new_tab = function()
57+
actions.switch();
58+
keyboard.stroke("control", "T");
59+
end
60+
61+
--@help Type address
62+
actions.address = function()
63+
actions.switch();
64+
keyboard.stroke("control", "L");
65+
device.keyboard();
66+
end
67+
68+
--@help Go to home page
69+
actions.home = function()
70+
actions.switch();
71+
keyboard.stroke("menu", "home");
72+
end
73+
74+
--@help Find on current page
75+
actions.find = function()
76+
actions.switch();
77+
keyboard.stroke("control", "F");
78+
device.keyboard();
79+
end
80+
81+
--@help Zoom page in
82+
actions.zoom_in = function()
83+
actions.switch();
84+
keyboard.stroke("control", "oem_plus");
85+
end
86+
87+
--@help Zoom page out
88+
actions.zoom_out = function()
89+
actions.switch();
90+
keyboard.stroke("control", "oem_minus");
91+
end
92+
93+
--@help Use normal zoom
94+
actions.zoom_normal = function()
95+
actions.switch();
96+
keyboard.stroke("control", "0");
97+
end
98+
99+
--@help Scroll page down
100+
actions.scroll_down = function()
101+
actions.switch();
102+
keyboard.stroke("pgdown");
103+
end
104+
105+
--@help Scroll page up
106+
actions.scroll_up = function()
107+
actions.switch();
108+
keyboard.stroke("pgup");
109+
end
110+
111+
--@help Refresh current page
112+
actions.refresh = function()
113+
actions.switch();
114+
keyboard.stroke("F5");
115+
end

Main/Edge/remote_osx.lua

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
local keyboard = libs.keyboard;
2+
local device = libs.device;
3+
4+
events.detect = function ()
5+
return libs.fs.exists("/Applications/Microsoft Edge.app");
6+
end
7+
8+
--@help Focus Edge application
9+
actions.switch = function()
10+
os.script("tell application \"Microsoft Edge\" to reopen activate");
11+
end
12+
13+
--@help Launch Edge application
14+
actions.launch = function()
15+
os.open("/Applications/Microsoft Edge.app");
16+
end
17+
18+
--@help Naviagte back
19+
actions.back = function()
20+
actions.switch();
21+
keyboard.stroke("cmd", "left");
22+
end
23+
24+
--@help Close current tab
25+
actions.close_tab = function()
26+
actions.switch();
27+
keyboard.stroke("cmd", "W");
28+
end
29+
30+
--@help Navigate forward
31+
actions.forward = function()
32+
actions.switch();
33+
keyboard.stroke("cmd", "right");
34+
end
35+
36+
--@help Go to next tab
37+
actions.next_tab = function()
38+
actions.switch();
39+
keyboard.stroke("cmd", "option", "right");
40+
end
41+
42+
--@help Go to previous tab
43+
actions.previous_tab = function()
44+
actions.switch();
45+
keyboard.stroke("cmd", "option", "left");
46+
end
47+
48+
--@help Open new tab
49+
actions.new_tab = function()
50+
actions.switch();
51+
keyboard.stroke("cmd", "T");
52+
end
53+
54+
--@help Type address
55+
actions.address = function()
56+
actions.switch();
57+
keyboard.stroke("cmd", "L");
58+
-- Without keyboard up chrome chrash.
59+
keyboard.up("cmd", "L");
60+
device.keyboard();
61+
end
62+
63+
--@help Go to home page
64+
actions.home = function()
65+
actions.switch();
66+
keyboard.stroke("cmd", "shift", "H");
67+
end
68+
69+
--@help Find on current page
70+
actions.find = function()
71+
actions.switch();
72+
keyboard.stroke("cmd", "F");
73+
-- Without keyboard up chrome chrash.
74+
keyboard.up("cmd", "F");
75+
device.keyboard();
76+
end
77+
78+
--@help Zoom page in
79+
actions.zoom_in = function()
80+
actions.switch();
81+
keyboard.stroke("cmd", "plus");
82+
end
83+
84+
--@help Zoom page out
85+
actions.zoom_out = function()
86+
actions.switch();
87+
keyboard.stroke("cmd", "kpminus");
88+
end
89+
90+
--@help Use normal zoom
91+
actions.zoom_normal = function()
92+
actions.switch();
93+
keyboard.stroke("cmd", "0");
94+
end
95+
96+
--@help Scroll page down
97+
actions.scroll_down = function()
98+
actions.switch();
99+
keyboard.stroke("pgdown");
100+
end
101+
102+
--@help Scroll page up
103+
actions.scroll_up = function()
104+
actions.switch();
105+
keyboard.stroke("pgup");
106+
end
107+
108+
--@help Refresh current page
109+
actions.refresh = function()
110+
actions.switch();
111+
keyboard.stroke("cmd", "R");
112+
end

0 commit comments

Comments
 (0)