Martin Storsjö c4f257cb74 [llvm-rc] Allow ALT on non-virtkey accelerators (#143374)
While
https://learn.microsoft.com/en-us/windows/win32/menurc/accelerators-resource
specifies that ALT only applies to virtkeys, this doesn't seem to be the
case in reality.

https://learn.microsoft.com/en-us/windows/win32/menurc/using-keyboard-accelerators
contains an example that uses this combination:

    "B",   ID_ACCEL5, ALT                   ; ALT_SHIFT+B

Also Microsoft also includes such cases in their repo of test cases:
263dd514ad/Samples/Win7Samples/begin/sdkdiff/sdkdiff.rc (L161-L164)

Also MS rc.exe doesn't warn/error about this. However if applying SHIFT
or CONTROL on a non-virtkey accelerator, MS rc.exe does produce this
warning:

    warning RC4203 : SHIFT or CONTROL used without VIRTKEY

Hence, keep the checks for SHIFT and CONTROL, but remove the checks for
ALT, which seems to have been incorrect.

This fixes one aspect of
https://github.com/llvm/llvm-project/issues/143157.

(cherry picked from commit 77347d6513de6a6f5dee8ade76e0a0ad1552c12b)
2025-06-12 11:43:08 -07:00
..

The LLVM Compiler Infrastructure
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.