MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / ParseOptions

Method ParseOptions

source/script2.cpp:357–403  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

355
356
357void input_type::ParseOptions(LPTSTR aOptions)
358{
359 for (LPTSTR cp = aOptions; *cp; ++cp)
360 {
361 switch(ctoupper(*cp))
362 {
363 case 'B':
364 BackspaceIsUndo = false;
365 break;
366 case 'C':
367 CaseSensitive = true;
368 break;
369 case 'I':
370 MinSendLevel = (cp[1] <= '9' && cp[1] >= '0') ? (SendLevelType)_ttoi(cp + 1) : 1;
371 break;
372 case 'M':
373 TranscribeModifiedKeys = true;
374 break;
375 case 'L':
376 // Use atoi() vs. ATOI() to avoid interpreting something like 0x01C as hex
377 // when in fact the C was meant to be an option letter:
378 BufferLengthMax = _ttoi(cp + 1);
379 if (BufferLengthMax < 0)
380 BufferLengthMax = 0;
381 break;
382 case 'T':
383 // Although ATOF() supports hex, it's been documented in the help file that hex should
384 // not be used (see comment above) so if someone does it anyway, some option letters
385 // might be misinterpreted:
386 Timeout = (int)(ATOF(cp + 1) * 1000);
387 break;
388 case 'V':
389 VisibleText = true;
390 VisibleNonText = true;
391 break;
392 case '*':
393 FindAnywhere = true;
394 break;
395 case 'E':
396 // Interpret single-character keys as characters rather than converting them to VK codes.
397 // This tends to work better when using multiple keyboard layouts, but changes behaviour:
398 // for instance, an end char of "." cannot be triggered while holding Alt.
399 EndCharMode = true;
400 break;
401 }
402 }
403}
404
405
406void input_type::SetTimeoutTimer()

Callers

nothing calls this directly

Calls 2

ctoupperFunction · 0.85
ATOFFunction · 0.85

Tested by

no test coverage detected