-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
not part of 1.0.24 spec but common and useful enough to add it now
- Loading branch information
Showing
5 changed files
with
134 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
require "./mouse-click" | ||
|
||
# Click [, Options] | ||
# Not part of 1.0.24! | ||
class Cmd::X11::Mouse::Click < Cmd::X11::Mouse::MouseClick | ||
def self.min_args; 0 end | ||
def self.max_args; 1 end | ||
def run(thread, args) | ||
mouse_click_args = Array(::String).new(7){""} | ||
ints = [] of ::String | ||
(args[0]? || "").split.each do |param| | ||
case param.downcase | ||
when "l","r","left","right","m","middle","xbutton1","xbutton2","x1","x2","wheelup","wu","wheeldown","wd","wheelleft","wl","wheelright","wr" | ||
mouse_click_args[0] = param | ||
when "down","up","d","u" | ||
mouse_click_args[5] = param[0].to_s | ||
when "rel","relative" | ||
mouse_click_args[6] = "r" | ||
else | ||
ints << param if param.to_i? | ||
end | ||
end | ||
if ints.size == 1 | ||
mouse_click_args[3] = ints[0] | ||
elsif ints.size >= 2 | ||
mouse_click_args[1] = ints[0] | ||
mouse_click_args[2] = ints[1] | ||
mouse_click_args[3] = ints[2]? || "" | ||
end | ||
parse_run(thread, mouse_click_args) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters