maclight 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/README.md +1 -1
- data/ext/maclight/maclight.c +8 -8
- data/lib/maclight/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: b1a237281b1268ddb97f94efe87643bea60824e0d9ab755a6f34d2f6bfa95bbd
|
4
|
+
data.tar.gz: 574ea4d5ff4894f90c1f9c5956b1a94a69a50658c39c8c99c9f85314c3dcf9a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2fa1f7fa955b4ad9a86abf502f98f858295eb0cfd7529fea95eb8aacef1779608d04be4b3e7be3c26256d5e2ded386ea37f21ddd1055b3af2532d614f6160c05
|
7
|
+
data.tar.gz: 56286f016f6d943e1e388936dcabd0941e43c8a31af124775e7774eafe81146060a1b5a8aad21b9cae564ddf0d4a5c652bd1477c95fa58a6be74dfd23744b356
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# MacLight [](https://gemnasium.com/busyloop/maclight)
|
1
|
+
# MacLight [](https://gemnasium.com/busyloop/maclight) [](https://badge.fury.io/rb/maclight)
|
2
2
|
|
3
3
|
MacLight lets you control the keyboard LEDs on your Mac or Macbook.
|
4
4
|
|
data/ext/maclight/maclight.c
CHANGED
@@ -127,13 +127,13 @@ int manipulate_led( int which_led, int led_value )
|
|
127
127
|
|
128
128
|
// create a IO HID Manager reference
|
129
129
|
IOHIDManagerRef tIOHIDManagerRef = IOHIDManagerCreate( kCFAllocatorDefault, kIOHIDOptionsTypeNone );
|
130
|
-
|
130
|
+
__Require( tIOHIDManagerRef, Oops );
|
131
131
|
|
132
132
|
// Create a device matching dictionary
|
133
133
|
CFDictionaryRef matchingCFDictRef = hu_CreateMatchingDictionaryUsagePageUsage( TRUE,
|
134
134
|
kHIDPage_GenericDesktop,
|
135
135
|
kHIDUsage_GD_Keyboard );
|
136
|
-
|
136
|
+
__Require( matchingCFDictRef, Oops );
|
137
137
|
|
138
138
|
// set the HID device matching dictionary
|
139
139
|
IOHIDManagerSetDeviceMatching( tIOHIDManagerRef, matchingCFDictRef );
|
@@ -144,11 +144,11 @@ int manipulate_led( int which_led, int led_value )
|
|
144
144
|
|
145
145
|
// Now open the IO HID Manager reference
|
146
146
|
IOReturn tIOReturn = IOHIDManagerOpen( tIOHIDManagerRef, kIOHIDOptionsTypeNone );
|
147
|
-
|
147
|
+
__Require_noErr( tIOReturn, Oops );
|
148
148
|
|
149
149
|
// and copy out its devices
|
150
150
|
CFSetRef deviceCFSetRef = IOHIDManagerCopyDevices( tIOHIDManagerRef );
|
151
|
-
|
151
|
+
__Require( deviceCFSetRef, Oops );
|
152
152
|
|
153
153
|
// how many devices in the set?
|
154
154
|
CFIndex deviceIndex, deviceCount = CFSetGetCount( deviceCFSetRef );
|
@@ -168,7 +168,7 @@ int manipulate_led( int which_led, int led_value )
|
|
168
168
|
|
169
169
|
// before we get into the device loop we'll setup our element matching dictionary
|
170
170
|
matchingCFDictRef = hu_CreateMatchingDictionaryUsagePageUsage( FALSE, kHIDPage_LEDs, 0 );
|
171
|
-
|
171
|
+
__Require( matchingCFDictRef, Oops );
|
172
172
|
|
173
173
|
int pass; // do 256 passes
|
174
174
|
//for ( pass = 0; pass < 256; pass++ ) {
|
@@ -188,7 +188,7 @@ int manipulate_led( int which_led, int led_value )
|
|
188
188
|
CFArrayRef elementCFArrayRef = IOHIDDeviceCopyMatchingElements( tIOHIDDeviceRefs[deviceIndex],
|
189
189
|
matchingCFDictRef,
|
190
190
|
kIOHIDOptionsTypeNone );
|
191
|
-
|
191
|
+
__Require( elementCFArrayRef, next_device );
|
192
192
|
|
193
193
|
// for each device on the system these values are divided by the value ranges of all LED elements found
|
194
194
|
// for example, if the first four LED element have a range of 0-1 then the four least significant bits of
|
@@ -199,7 +199,7 @@ int manipulate_led( int which_led, int led_value )
|
|
199
199
|
CFIndex elementIndex, elementCount = CFArrayGetCount( elementCFArrayRef );
|
200
200
|
for ( elementIndex = 0; elementIndex < elementCount; elementIndex++ ) {
|
201
201
|
IOHIDElementRef tIOHIDElementRef = ( IOHIDElementRef ) CFArrayGetValueAtIndex( elementCFArrayRef, elementIndex );
|
202
|
-
|
202
|
+
__Require( tIOHIDElementRef, next_element );
|
203
203
|
|
204
204
|
uint32_t usagePage = IOHIDElementGetUsagePage( tIOHIDElementRef );
|
205
205
|
|
@@ -234,7 +234,7 @@ int manipulate_led( int which_led, int led_value )
|
|
234
234
|
// now set it on the device
|
235
235
|
tIOReturn = IOHIDDeviceSetValue( tIOHIDDeviceRefs[deviceIndex], tIOHIDElementRef, tIOHIDValueRef );
|
236
236
|
CFRelease( tIOHIDValueRef );
|
237
|
-
|
237
|
+
__Require_noErr( tIOReturn, next_element );
|
238
238
|
delayFlag = TRUE; // set this TRUE so we'll delay before changing our LED values again
|
239
239
|
}
|
240
240
|
next_element: ;
|
data/lib/maclight/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: maclight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Moe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: optix
|
@@ -79,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
79
|
version: '0'
|
80
80
|
requirements: []
|
81
81
|
rubyforge_project:
|
82
|
-
rubygems_version: 2.
|
82
|
+
rubygems_version: 2.7.3
|
83
83
|
signing_key:
|
84
84
|
specification_version: 4
|
85
85
|
summary: Control your Mac keyboard LEDs (capslock, numlock)
|