KiCad PCB EDA Suite
scintilla_tricks.cpp File Reference
#include <string_utils.h>
#include <scintilla_tricks.h>
#include <wx/stc/stc.h>
#include <gal/color4d.h>
#include <dialog_shim.h>
#include <wx/clipbrd.h>
#include <wx/log.h>
#include <wx/settings.h>
#include <confirm.h>

Go to the source code of this file.

Functions

bool isCtrlSlash (wxKeyEvent &aEvent)
 

Function Documentation

◆ isCtrlSlash()

bool isCtrlSlash ( wxKeyEvent &  aEvent)

Definition at line 118 of file scintilla_tricks.cpp.

119 {
120  if( !aEvent.ControlDown() || aEvent.MetaDown() )
121  return false;
122 
123  if( aEvent.GetUnicodeKey() == '/' )
124  return true;
125 
126  // OK, now the wxWidgets hacks start.
127  // (We should abandon these if https://trac.wxwidgets.org/ticket/18911 gets resolved.)
128 
129  // Many Latin America and European keyboars have have the / over the 7. We know that
130  // wxWidgets messes this up and returns Shift+7 through GetUnicodeKey(). However, other
131  // keyboards (such as France and Belgium) have 7 in the shifted position, so a Shift+7
132  // *could* be legitimate.
133 
134  // However, we *are* checking Ctrl, so to assume any Shift+7 is a Ctrl-/ really only
135  // disallows Ctrl+Shift+7 from doing something else, which is probably OK. (This routine
136  // is only used in the Scintilla editor, not in the rest of Kicad.)
137 
138  // The other main shifted loation of / is over : (France and Belgium), so we'll sacrifice
139  // Ctrl+Shift+: too.
140 
141  if( aEvent.ShiftDown() && ( aEvent.GetUnicodeKey() == '7' || aEvent.GetUnicodeKey() == ':' ) )
142  return true;
143 
144  // A few keyboards have / in an Alt position. Since we're expressly not checking Alt for
145  // up or down, those should work. However, if they don't, there's room below for yet
146  // another hack....
147 
148  return false;
149 }

Referenced by SCINTILLA_TRICKS::onCharHook().