forked from Eyescale/Equalizer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Stefan Eilemann
authored and
Stefan Eilemann
committed
Oct 26, 2016
1 parent
9291968
commit e59af62
Showing
11 changed files
with
81 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
|
||
/* Copyright (c) 2007-2014, Stefan Eilemann <[email protected]> | ||
/* Copyright (c) 2007-2016, Stefan Eilemann <[email protected]> | ||
* | ||
* This library is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU Lesser General Public License version 2.1 as published | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
|
||
/* Copyright (c) 2014, Daniel Nachbaur <[email protected]> | ||
/* Copyright (c) 2014-2016, Daniel Nachbaur <[email protected]> | ||
* | ||
* This library is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU Lesser General Public License version 2.1 as published | ||
|
@@ -18,7 +18,9 @@ | |
#ifndef EQFABRIC_EVENTENUMS_H | ||
#define EQFABRIC_EVENTENUMS_H | ||
|
||
#include <lunchbox/bitOperation.h> | ||
#include <lunchbox/types.h> | ||
#include <iostream> | ||
|
||
namespace eq | ||
{ | ||
|
@@ -99,15 +101,51 @@ enum PointerButton | |
* Key modifiers | ||
* @version 2.0 | ||
*/ | ||
enum KeyModifier | ||
enum class KeyModifier : unsigned | ||
{ | ||
KM_NONE = LB_BIT_NONE, | ||
KM_ALT = LB_BIT1, | ||
KM_CONTROL = LB_BIT2, | ||
KM_SHIFT = LB_BIT3, | ||
none = LB_BIT_NONE, | ||
alt = LB_BIT1, | ||
control = LB_BIT2, | ||
shift = LB_BIT3, | ||
}; | ||
|
||
inline KeyModifier operator & ( const KeyModifier l, const KeyModifier r ) | ||
{ | ||
return static_cast< KeyModifier >( static_cast< unsigned >( l ) & | ||
static_cast< unsigned >( r )); | ||
} | ||
|
||
inline KeyModifier operator | ( const KeyModifier l, const KeyModifier r ) | ||
{ | ||
return static_cast< KeyModifier >( static_cast< unsigned >( l ) | | ||
static_cast< unsigned >( r )); | ||
} | ||
|
||
inline KeyModifier& operator |= ( KeyModifier& l, const KeyModifier r ) | ||
{ | ||
return l = l | r; | ||
} | ||
|
||
inline std::ostream& operator << ( std::ostream& os, const KeyModifier mod ) | ||
{ | ||
if( (mod & KeyModifier::alt) == KeyModifier::alt ) | ||
os << " alt"; | ||
if( (mod & KeyModifier::control) == KeyModifier::control ) | ||
os << " ctrl"; | ||
if( (mod & KeyModifier::shift) == KeyModifier::shift ) | ||
os << " shift"; | ||
return os; | ||
} | ||
|
||
} | ||
} | ||
} | ||
|
||
namespace lunchbox | ||
{ | ||
template<> inline void byteswap( eq::fabric::eventEnums::KeyModifier& value ) | ||
{ | ||
byteswap( reinterpret_cast< unsigned& >( value )); | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
|
||
/* Copyright (c) 2007-2013, Stefan Eilemann <[email protected]> | ||
/* Copyright (c) 2007-2016, Stefan Eilemann <[email protected]> | ||
* | ||
* This library is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU Lesser General Public License version 2.1 as published | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
|
||
/* Copyright (c) 2011-2012, Stefan Eilemann <[email protected]> | ||
/* Copyright (c) 2011-2016, Stefan Eilemann <[email protected]> | ||
* | ||
* This library is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU Lesser General Public License version 2.1 as published | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters