Comments (7)
in main.cpp, around line 460, I made a change to the call of mShaderEditor.KeyDown like so:
if (Renderer::keyEventBuffer[i].scanCode)
{
// TODO: https://github.com/Gargaj/Bonzomatic/issues/144
int sc = Renderer::keyEventBuffer[i].scanCode;
mShaderEditor.KeyDown(
Renderer::keyEventBuffer[i].character < 128 ? sc : iswalpha(sc) ? towupper(sc) : sc,
Renderer::keyEventBuffer[i].shift,
Renderer::keyEventBuffer[i].ctrl,
Renderer::keyEventBuffer[i].alt,
&consumed);
}
from bonzomatic.
The quickfix worked for me. Giving the proverbial test ride thanks to you @BetaSoftCologne !
from bonzomatic.
from bonzomatic.
I can reproduce the issue, but, this isn't Linux-specific:
Adding a printf in the GLFW key callback shows that GLFW is able to distinguish between these four keys, and that the equivalent Scintilla key values are set. Ergo, it's not a platform thing.
However, this code here happily turns scancode 301 (up) into 300 (down), and 303 into 302, while leaving the other two untouched. Unicode codepoints 300 and 301 (U+012C and U+012D) happen to be 'Ĭ' (I with breve) and 'ĭ', respectively, 302 and 303 are 'Į' and 'į'. I very much doubt this is intended.
So I see three options:
- Check for ascii characters in the scancode, and only convert to uppercase in that situation. This mightn't be desirable for some keyboards.
- Add an extra flag to the key input buffer to tell the buggy code to only convert characters when that is set (basically
bNormalKey
here), but this will require testing for all platforms. - Always convert to uppercase in all the platform-specific code (GLFW is currently converting to lowercase??)
Any preference, @Gargaj ?
from bonzomatic.
Same here. My box:
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.5 LTS"
from bonzomatic.
I made it work for me with a quick hack, but it made we wonder of the purpose of scanCode in general. Especially since a) there is also character which I assume contains the character (aka code point) of the key pressed and b) scanCode is used in comparisons as if it also contained a code point, like in line 453:
if (Renderer::keyEventBuffer[i].scanCode == 292 || (Renderer::keyEventBuffer[i].ctrl && Renderer::keyEventBuffer[i].scanCode == 'f')) // F11 or Ctrl/Cmd-f
I assumed that scanCode contained something like the key-number or so, not the character, but that's apparently not the case.
from bonzomatic.
$ cat /etc/os-release
NAME="Linux Mint"
VERSION="19.2 (Tina)"
ID=linuxmint
ID_LIKE=ubuntu
PRETTY_NAME="Linux Mint 19.2"
VERSION_ID="19.2"
HOME_URL="https://www.linuxmint.com/"
SUPPORT_URL="https://forums.linuxmint.com/"
BUG_REPORT_URL="http://linuxmint-troubleshooting-guide.readthedocs.io/en/latest/"
PRIVACY_POLICY_URL="https://www.linuxmint.com/"
VERSION_CODENAME=tina
UBUNTU_CODENAME=bionic
Same. @BetaSoftCologne can you explain how you fixed this? Or should I wait for a PR, I really wanted to try this...
from bonzomatic.
Related Issues (20)
- GLX: Failed to create context: GLXBadFBConfig HOT 1
- Unable to get FFT working on windows (GLFW) HOT 3
- Sync Mode for online only events HOT 4
- [ubuntu] alsa sound dependency HOT 2
- Download and install HOT 8
- File access issues on macOS HOT 7
- MacOS build fails HOT 3
- Bonzomatic doesn't restore resolution upon exit on linux (kwin/kde) HOT 3
- Build failure on macOS 10.13 HOT 3
- postExit command not executed on Linux HOT 3
- Segfault if load shader.glsl with national symbols in commentaries (UTF-8 trouble?) HOT 14
- Can't open Bonzomatic to fullscreen in Windows 10 Pro HOT 1
- How to forward user data between frames in Bonzomatic? HOT 5
- Too darkness texture HOT 4
- Quick reference or Documentation? HOT 5
- Unicode crash on FreeBSD
- Build failure on armv7 FreeBSD 13.1 HOT 1
- Low res text and ignored config.json on macOS Ventura 13.4 HOT 3
- macOS: Bonzomatic.app requires Rosetta (2) to be installed? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bonzomatic.