Little cleanup.
This commit is contained in:
@@ -29,14 +29,14 @@ KEY_MAP = {
|
||||
"9" => 18,
|
||||
"0" => 19
|
||||
}
|
||||
def bind(key, mod = :alt, &block)
|
||||
def bind(key, mod = :super, &block)
|
||||
key_ = key.is_a?(String) ? KEY_MAP[key] : key
|
||||
mod = MOD_MAP[mod]
|
||||
raise "unknown key #{key.to_s}" unless key_
|
||||
raise "unknown modifier" unless mod
|
||||
_bind key_, mod, &block
|
||||
end
|
||||
def unbind(key, mod = :alt)
|
||||
def unbind(key, mod = :super)
|
||||
key_ = key.is_a?(String) ? KEY_MAP[key] : key
|
||||
mod = MOD_MAP[mod]
|
||||
raise "unknown key #{key.to_s}" unless key_
|
||||
@@ -149,24 +149,24 @@ end
|
||||
end
|
||||
end
|
||||
|
||||
bind 86 do |_, ws|
|
||||
bind 86, :none do |_, ws|
|
||||
next unless in_project?(ws)
|
||||
n = (($current_project - 2) % MAX_PROJECTS) + 1
|
||||
go_project(n, $current_sub)
|
||||
end
|
||||
|
||||
bind 82 do |_, ws|
|
||||
bind 82, :none do |_, ws|
|
||||
next unless in_project?(ws)
|
||||
n = ($current_project % MAX_PROJECTS) + 1
|
||||
go_project(n, $current_sub)
|
||||
end
|
||||
|
||||
bind 79 do |_, ws|
|
||||
bind 79, :none do |_, ws|
|
||||
next unless in_project?(ws)
|
||||
go_project($current_project, ($current_sub + 1) % SUBS)
|
||||
end
|
||||
|
||||
bind 80 do |_, ws|
|
||||
bind 80, :none do |_, ws|
|
||||
next unless in_project?(ws)
|
||||
go_project($current_project, ($current_sub - 1 + SUBS) % SUBS)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user