Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef bool (*InputFunc)(Input const*);
- template<InputFunc Function1, InputFunc... Functions>
- struct Logic {
- static inline bool conjunction(Input const* input) {
- return Function1(input) && Logic<Functions...>::conjunction(input);
- }
- static inline bool disjunction(Input const* input) {
- return Function1(input) || Logic<Functions...>::disjunction(input);
- }
- };
- template<InputFunc Function1>
- struct Logic<Function1> {
- static inline bool conjunction(Input const* input) {
- return Function1(input);
- }
- static inline bool disjunction(Input const* input) {
- return Function1(input);
- }
- };
- if (
- Logic<
- Logic<
- Key::pressed<Key::LEFT_CONTROL>,
- Key::wentDown<Key::C>
- >::conjunction,
- Mouse::wentDown<Mouse::RIGHT>
- >::disjunction(&input)
- ) {
- printf("LCtrl + C or right mouse pressed.\n");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement