Skip to content

tkgka/ArrayFlags

Repository files navigation

ArrayFlags

CI Status Version License Platform Hits

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

ArrayFlags is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'ArrayFlags'

Usage

First, add import ArrayFlags on every swift file you would like to use ArrayFlags.

Then, use functions to return arrayed flags!

"GetDictFlags" and "GetDictFlagsString" returns Dict type value and "GetArrayFlags" returns array value

Parameters:

Val: Uint value which convert to array type

print("GetDictFlags",GetDictFlags(Val: NSEvent.modifierFlags.rawValue)) // return Seperated Flag value by Dict type
print("GetArrayFlags",GetArrayFlags(Val: NSEvent.modifierFlags.rawValue)) //return arrayed Flag value
print("GetDictFlagsString",GetDictFlagsString(Val: NSEvent.modifierFlags.rawValue)) // return pressed key value by Dict type

image

"GetDictFlagsString" function returns L, R or B for shift, ctrl, option and command flags

"L" means Left key pressed

"R" means Right key pressed

"B" means Both key pressed

Author

tkgka, ksh17171@gmail.com

License

ArrayFlags is available under the MIT license. See the LICENSE file for more info.