Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ PATH_AUDIO ?= "./wav"

CFLAGS ?= -O3 -g
LDFLAGS ?= -g
CFLAGS += -Wall -Werror
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't agree with that - what warning do you run into, and can't we just fix that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally a big fan of -Werror ;) However, it's a workaround for the current situation on macOS 11:

% make
cc -I/usr/local/opt/ruby/include -O3 -g -Wall -Werror -DVERSION=\"1.4.0\" -DPATH_AUDIO=\""./wav"\" -I/usr/local/Cellar/alure/1.2_1/include -c main.c -o main.o
main.c:155:16: error: 'alcGetString' is deprecated: first deprecated in macOS 10.15 - OpenAL is deprecated in favor of AVAudioEngine [-Werror,-Wdeprecated-declarations]
                opt_device = alcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER);
                             ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenAL.framework/Headers/alc.h:236:38: note: 'alcGetString'
      has been explicitly marked deprecated here
ALC_API const ALCchar * ALC_APIENTRY alcGetString( ALCdevice *device, ALCenum param ) OPENAL_DEPRECATED;
                                     ^
main.c:160:11: error: 'alcOpenDevice' is deprecated: first deprecated in macOS 10.15 - OpenAL is deprecated in favor of AVAudioEngine [-Werror,-Wdeprecated-declarations]
        device = alcOpenDevice(opt_device);
                 ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenAL.framework/Headers/alc.h:209:38: note: 
      'alcOpenDevice' has been explicitly marked deprecated here
ALC_API ALCdevice *     ALC_APIENTRY alcOpenDevice( const ALCchar *devicename ) OPENAL_DEPRECATED;
                                     ^
main.c:167:12: error: 'alcCreateContext' is deprecated: first deprecated in macOS 10.15 - OpenAL is deprecated in favor of AVAudioEngine [-Werror,-Wdeprecated-declarations]
        context = alcCreateContext(device, NULL);
                  ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenAL.framework/Headers/alc.h:191:38: note: 
      'alcCreateContext' has been explicitly marked deprecated here
ALC_API ALCcontext *    ALC_APIENTRY alcCreateContext( ALCdevice *device, const ALCint* attrlist ) OPENAL_DEPRECATED;
                                     ^
main.c:168:7: error: 'alcMakeContextCurrent' is deprecated: first deprecated in macOS 10.15 - OpenAL is deprecated in favor of AVAudioEngine [-Werror,-Wdeprecated-declarations]
        if (!alcMakeContextCurrent(context)) {
             ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenAL.framework/Headers/alc.h:193:38: note: 
      'alcMakeContextCurrent' has been explicitly marked deprecated here
ALC_API ALCboolean      ALC_APIENTRY alcMakeContextCurrent( ALCcontext *context ) OPENAL_DEPRECATED;
                                     ^
main.c:172:2: error: 'alGetError' is deprecated: first deprecated in macOS 10.15 - OpenAL is deprecated in favor of AVAudioEngine [-Werror,-Wdeprecated-declarations]
        TEST_ERROR("make default context");
        ^
main.c:28:10: note: expanded from macro 'TEST_ERROR'
        error = alGetError();           \
                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenAL.framework/Headers/al.h:405:27: note: 'alGetError' has
      been explicitly marked deprecated here
AL_API ALenum AL_APIENTRY alGetError( void ) OPENAL_DEPRECATED;
                          ^
main.c:174:2: error: 'alListener3f' is deprecated: first deprecated in macOS 10.15 - OpenAL is deprecated in favor of AVAudioEngine [-Werror,-Wdeprecated-declarations]
        alListener3f(AL_POSITION, 0, 0, 0);
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenAL.framework/Headers/al.h:438:25: note: 'alListener3f'
      has been explicitly marked deprecated here
AL_API void AL_APIENTRY alListener3f( ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 ) OPENAL_DEPRECATED;
                        ^
main.c:175:2: error: 'alListener3f' is deprecated: first deprecated in macOS 10.15 - OpenAL is deprecated in favor of AVAudioEngine [-Werror,-Wdeprecated-declarations]
        alListener3f(AL_VELOCITY, 0, 0, 0);
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenAL.framework/Headers/al.h:438:25: note: 'alListener3f'
      has been explicitly marked deprecated here
AL_API void AL_APIENTRY alListener3f( ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 ) OPENAL_DEPRECATED;
                        ^
main.c:176:2: error: 'alListenerfv' is deprecated: first deprecated in macOS 10.15 - OpenAL is deprecated in favor of AVAudioEngine [-Werror,-Wdeprecated-declarations]
        alListenerfv(AL_ORIENTATION, listenerOri);
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenAL.framework/Headers/al.h:440:25: note: 'alListenerfv'
      has been explicitly marked deprecated here
AL_API void AL_APIENTRY alListenerfv( ALenum param, const ALfloat* values ) OPENAL_DEPRECATED;
                        ^
main.c:191:11: error: 'alcGetContextsDevice' is deprecated: first deprecated in macOS 10.15 - OpenAL is deprecated in favor of AVAudioEngine [-Werror,-Wdeprecated-declarations]
        device = alcGetContextsDevice(context);
                 ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenAL.framework/Headers/alc.h:203:38: note: 
      'alcGetContextsDevice' has been explicitly marked deprecated here
ALC_API ALCdevice*      ALC_APIENTRY alcGetContextsDevice( ALCcontext *context ) OPENAL_DEPRECATED;
                                     ^
main.c:192:2: error: 'alcMakeContextCurrent' is deprecated: first deprecated in macOS 10.15 - OpenAL is deprecated in favor of AVAudioEngine [-Werror,-Wdeprecated-declarations]
        alcMakeContextCurrent(NULL);
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenAL.framework/Headers/alc.h:193:38: note: 
      'alcMakeContextCurrent' has been explicitly marked deprecated here
ALC_API ALCboolean      ALC_APIENTRY alcMakeContextCurrent( ALCcontext *context ) OPENAL_DEPRECATED;
                                     ^
main.c:193:14: error: 'alcDestroyContext' is deprecated: first deprecated in macOS 10.15 - OpenAL is deprecated in favor of AVAudioEngine [-Werror,-Wdeprecated-declarations]
        if(context) alcDestroyContext(context);
                    ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenAL.framework/Headers/alc.h:199:38: note: 
      'alcDestroyContext' has been explicitly marked deprecated here
ALC_API void            ALC_APIENTRY alcDestroyContext( ALCcontext *context ) OPENAL_DEPRECATED;
                                     ^
main.c:194:13: error: 'alcCloseDevice' is deprecated: first deprecated in macOS 10.15 - OpenAL is deprecated in favor of AVAudioEngine [-Werror,-Wdeprecated-declarations]
        if(device) alcCloseDevice(device);
                   ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenAL.framework/Headers/alc.h:211:38: note: 
      'alcCloseDevice' has been explicitly marked deprecated here
ALC_API ALCboolean      ALC_APIENTRY alcCloseDevice( ALCdevice *device ) OPENAL_DEPRECATED;
                                     ^
main.c:224:27: error: 'alcGetString' is deprecated: first deprecated in macOS 10.15 - OpenAL is deprecated in favor of AVAudioEngine [-Werror,-Wdeprecated-declarations]
        const ALCchar *devices = alcGetString(NULL, ALC_DEVICE_SPECIFIER);
                                 ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenAL.framework/Headers/alc.h:236:38: note: 'alcGetString'
      has been explicitly marked deprecated here
ALC_API const ALCchar * ALC_APIENTRY alcGetString( ALCdevice *device, ALCenum param ) OPENAL_DEPRECATED;
                                     ^
main.c:352:3: error: 'alGenSources' is deprecated: first deprecated in macOS 10.15 - OpenAL is deprecated in favor of AVAudioEngine [-Werror,-Wdeprecated-declarations]
                alGenSources((ALuint)1, &src[idx]);
                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenAL.framework/Headers/al.h:498:25: note: 'alGenSources'
      has been explicitly marked deprecated here
AL_API void AL_APIENTRY alGenSources( ALsizei n, ALuint* sources ) OPENAL_DEPRECATED;
                        ^
main.c:353:3: error: 'alGetError' is deprecated: first deprecated in macOS 10.15 - OpenAL is deprecated in favor of AVAudioEngine [-Werror,-Wdeprecated-declarations]
                TEST_ERROR("source generation");
                ^
main.c:28:10: note: expanded from macro 'TEST_ERROR'
        error = alGetError();           \
                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenAL.framework/Headers/al.h:405:27: note: 'alGetError' has
      been explicitly marked deprecated here
AL_API ALenum AL_APIENTRY alGetError( void ) OPENAL_DEPRECATED;
                          ^
main.c:357:4: error: 'alSource3f' is deprecated: first deprecated in macOS 10.15 - OpenAL is deprecated in favor of AVAudioEngine [-Werror,-Wdeprecated-declarations]
                        alSource3f(src[idx], AL_POSITION, -x, 0, (100 - opt_stereo_width) / 100.0);
                        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenAL.framework/Headers/al.h:511:25: note: 'alSource3f' has
      been explicitly marked deprecated here
AL_API void AL_APIENTRY alSource3f( ALuint sid, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 ) OPENAL_DEPRECATED;
                        ^
main.c:359:3: error: 'alSourcef' is deprecated: first deprecated in macOS 10.15 - OpenAL is deprecated in favor of AVAudioEngine [-Werror,-Wdeprecated-declarations]
                alSourcef(src[idx], AL_GAIN, opt_gain / 100.0);
                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenAL.framework/Headers/al.h:509:25: note: 'alSourcef' has
      been explicitly marked deprecated here
AL_API void AL_APIENTRY alSourcef( ALuint sid, ALenum param, ALfloat value ) OPENAL_DEPRECATED;
                        ^
main.c:361:3: error: 'alSourcei' is deprecated: first deprecated in macOS 10.15 - OpenAL is deprecated in favor of AVAudioEngine [-Werror,-Wdeprecated-declarations]
                alSourcei(src[idx], AL_BUFFER, buf[idx]);
                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenAL.framework/Headers/al.h:515:25: note: 'alSourcei' has
      been explicitly marked deprecated here
AL_API void AL_APIENTRY alSourcei( ALuint sid, ALenum param, ALint value ) OPENAL_DEPRECATED;
                        ^
main.c:362:3: error: 'alGetError' is deprecated: first deprecated in macOS 10.15 - OpenAL is deprecated in favor of AVAudioEngine [-Werror,-Wdeprecated-declarations]
                TEST_ERROR("buffer binding");
                ^
main.c:28:10: note: expanded from macro 'TEST_ERROR'
        error = alGetError();           \
                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenAL.framework/Headers/al.h:405:27: note: 'alGetError' has
      been explicitly marked deprecated here
AL_API ALenum AL_APIENTRY alGetError( void ) OPENAL_DEPRECATED;
                          ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [main.o] Error 1

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow that's quite a mess. Well, I don't have an apple at hand and I don't feel like whipping up some complete CI for this, so let's move the -Werror out for now then...

CFLAGS += -Wall
CFLAGS += -DVERSION=\"$(VERSION)\"
CFLAGS += -DPATH_AUDIO=\"$(PATH_AUDIO)\"

Expand Down Expand Up @@ -60,7 +60,7 @@ dist:
rm -rf $(NAME)-$(VERSION)

rec: rec.c
gcc -Wall -Werror rec.c -o rec
gcc -Wall rec.c -o rec

clean:
$(RM) $(OBJS) $(BIN) core rec
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ ScrollLock twice (but be aware that those ScrollLock events _are_ delivered to
the application); same to unmute. The keycode for muting can be changed with
the `-m` option. Use keycode 0 to disable the mute function.

You can also use cherry mx blue sounds, pulled from the
keyclacker project https://github.com/spajus/keyclacker

Installation
------------

Expand Down Expand Up @@ -112,17 +115,16 @@ the following should do:
```
$ brew install alure pkg-config
$ git clone https://github.com/zevv/bucklespring.git && cd bucklespring
$ sed -i '' 's/-Wall -Werror/-Wall/' Makefile
$ make
$ ./buckle
```

Note that you need superuser privileges to create the event tap on Mac OS X.
Note that you might need superuser privileges to create the event tap on Mac OS X.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's been called macOS for a couple years now, with the last version being XI/11 instead of X/10

Also give your terminal Accessibility rights: system preferences -> security -> privacy -> accessibility

If you want to use buckle while doing normal work, add an & behind the command.
```
$ sudo ./buckle &
$ ./buckle &
```

### Windows
Expand Down Expand Up @@ -187,3 +189,4 @@ properly tuning OpenAL for bucklespring.
````
allow-moves = true
````

Binary file added wav-cherry/1c-0.wav
Binary file not shown.
Binary file added wav-cherry/1c-1.wav
Binary file not shown.
Binary file added wav-cherry/31-0.wav
Binary file not shown.
Binary file added wav-cherry/31-1.wav
Binary file not shown.
Binary file added wav-cherry/36-0.wav
Binary file not shown.
Binary file added wav-cherry/36-1.wav
Binary file not shown.
Binary file added wav-cherry/39-0.wav
Binary file not shown.
Binary file added wav-cherry/39-1.wav
Binary file not shown.
Binary file added wav-cherry/key_0_down.wav
Binary file not shown.
Binary file added wav-cherry/key_0_up.wav
Binary file not shown.
Binary file added wav-cherry/key_1_down.wav
Binary file not shown.
Binary file added wav-cherry/key_1_up.wav
Binary file not shown.
Binary file added wav-cherry/key_2_down.wav
Binary file not shown.
Binary file added wav-cherry/key_2_up.wav
Binary file not shown.
Binary file added wav-cherry/key_3_down.wav
Binary file not shown.
Binary file added wav-cherry/key_3_up.wav
Binary file not shown.