347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
|
# File 'lib/wrb/toplevelcommon.rb', line 347
def self.parse_hotkey(txt, no_repeat=true)
return nil if !txt || txt.empty?
modifier = no_repeat ? MOD_NOREPEAT : 0
key = nil
ar = txt.strip.split(/\+/)
if (str=ar.pop).length > 1
unless vk=ModKeyAccel::VFuncKey[str]
raise "Illegal key `#{str}'"
end
else
vk = str.upcase.unpack('c')[0]
end
ar.each{|ii|
raise "Illegal key `#{ii}'" unless n=Modifier[ii]
modifier |= n
}
[modifier, vk]
end
|