2 " @Author: Thomas Link (micathom AT gmail com?subject=[vim])
3 " @Website: http://www.vim.org/account/profile.php?user_id=4037
4 " @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
5 " @Created: 2007-06-30.
6 " @Last Change: 2007-10-21.
9 if &cp || exists("loaded_tlib_char_autoload")
12 let loaded_tlib_char_autoload = 1
15 " :def: function! tlib#char#Get(?timeout=0)
19 " echo tlib#char#Get()
20 " echo tlib#char#Get(5)
21 function! tlib#char#Get(...) "{{{3
22 TVarArg ['timeout', 0], ['resolution', 0]
23 if timeout == 0 || !has('reltime')
26 return tlib#char#GetWithTimeout(timeout, resolution)
32 function! tlib#char#IsAvailable() "{{{3
34 return type(ch) == 0 && ch != 0
38 function! tlib#char#GetWithTimeout(timeout, ...) "{{{3
39 TVarArg ['resolution', 2]
40 " TLogVAR a:timeout, resolution
41 let start = tlib#time#MSecs()
44 if type(c) != 0 || c != 0
47 let now = tlib#time#MSecs()
48 let diff = tlib#time#DiffMSecs(now, start, resolution)