Skip to content

Conversation

@danielsuss
Copy link

Summary

This PR adds two major features to Barrier:

🎯 Coordinate-Based Screen Switching

  • Extend switchToScreen action to accept optional coordinates: switchToScreen(screen,x,y)
  • GUI support for setting custom cursor positions when switching screens
  • Backward compatible - existing switchToScreen(screen) syntax still works
  • Enables precise cursor positioning for multi-monitor setups

⌨️ Grave Modifier Support

  • Full hotkey support for grave key (`) as modifier alongside Control, Alt, Shift
  • X11 integration with proper modifier mapping to Mod4
  • Consistent behavior across GUI and server components
  • Example: keystroke(Grave+1) = switchToScreen(screen1,960,540)

🔧 Compilation Improvements

  • Updated CMake minimum version requirements (3.4 → 3.5) for modern compatibility
  • Added missing #include <cstdint> headers for C++17+ compilers
  • Comprehensive compilation guide with exact build steps
  • Successfully builds on Ubuntu 24.04+ with GCC 13.3.0

Key Implementation Details

Coordinate Switching:

  • New SwitchToScreenAction constructor accepting x,y coordinates
  • Server-side switchScreen() integration for precise positioning
  • GUI controls in Action Dialog for coordinate input

Grave Modifier:

  • Added KeyModifierGrave constant (0x0080) and bit (7)
  • X11 mapping to Mod4Mask with fallback support
  • Updated hotkey registration to allow grave modifier
  • Qt GUI integration with custom GraveModifier constant

Backward Compatibility

✅ All existing configurations continue to work unchanged
✅ No breaking changes to API or config format
✅ Default behavior preserved when coordinates not specified

Test Results

  • ✅ Coordinate switching works with custom positions
  • ✅ Grave modifier hotkeys function correctly
  • ✅ Builds successfully on modern Linux systems
  • ✅ All existing functionality preserved
  • ✅ GUI controls work as expected

Documentation

  • Added GRAVE_MODIFIER_SETUP.md with setup instructions
  • Added COMPILATION_GUIDE.md with detailed build steps
  • Inline code documentation for new features

This enhancement significantly improves Barrier's usability for complex multi-monitor setups and provides additional hotkey modifier options.

🤖 Generated with Claude Code

danielsuss and others added 5 commits June 12, 2025 14:29
Implements support for using the grave key (`) as a hotkey modifier
in Barrier, enabling hotkey combinations like Grave+1, Grave+2, etc.

Key changes:
- Add XK_grave case to getModifierBitForKeySym() for XKB support
- Add fallback mapping for grave modifier to Mod4 in XKB path
- Include KeyModifierGrave in allowed modifiers for hotkey registration
- Add setup documentation for required X11 modifier mapping

Requires running: xmodmap -e "add mod4 = grave"

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add missing grave key definitions in KeySequence class
- Improve key type mapping for grave modifier
- Ensure consistent grave modifier behavior across GUI and core

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add coordinate-based screen switching and grave modifier support
@nbolton
Copy link

nbolton commented Jun 14, 2025

Please open this PR in Deskflow or Input Leap as Barrier is no longer in development.

https://github.com/deskflow/deskflow
https://github.com/input-leap/input-leap

Both are compatible with Barrier client/server so you can try on one of your computers.

Not sure which project to contribute to? The 'Insights' tab of each project may help you decide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants