equal
deleted
inserted
replaced
107 // Return error |
107 // Return error |
108 KeyBindToCode:= -1 |
108 KeyBindToCode:= -1 |
109 else begin |
109 else begin |
110 code:= 0; |
110 code:= 0; |
111 while (code <= High(CurrentBinds.indices)) and (CurrentBinds.indices[code] <> index) do inc(code); |
111 while (code <= High(CurrentBinds.indices)) and (CurrentBinds.indices[code] <> index) do inc(code); |
112 checkFails(code <= High(CurrentBinds.indices), 'binds registry inconsistency', True); |
112 checkFails(code <= High(CurrentBinds.indices), 'Inconsistency in key binding registry', True); |
113 KeyBindToCode:= code; |
113 KeyBindToCode:= code; |
114 end; |
114 end; |
115 end; |
115 end; |
116 |
116 |
117 // Takes a control name (e.g. 'quit') and returns the corresponding |
117 // Takes a control name (e.g. 'quit') and returns the corresponding |
331 end; |
331 end; |
332 |
332 |
333 procedure RegisterBind(var binds: TBinds; key, value: shortstring); |
333 procedure RegisterBind(var binds: TBinds; key, value: shortstring); |
334 var code: LongInt; |
334 var code: LongInt; |
335 begin |
335 begin |
336 checkFails(binds.lastIndex < 255, 'too many binds', true); |
336 checkFails(binds.lastIndex < 255, 'Too many key bindings', true); |
337 |
337 |
338 code:= KeyNameToCode(key); |
338 code:= KeyNameToCode(key); |
339 |
339 |
340 checkFails(code >= 0, 'unknown key', true); |
340 checkFails(code >= 0, 'unknown key', true); |
341 |
341 |