Detecting Ctrl-<Number> in GLUT - glut

I use GLUT to handle keyboard input for Bitfighter. I've built a nice little keyboard event abstraction layer, which works great for most things, but I've run up against a few frustrating limitations.
For example, when Ctrl is pressed, the number keys, plus, minus, and the quote key don't seem to trigger the glutKeyboardFunc() callback.
I realize that GLUT is very limited in some ways, but I was wondering if anyone knows if it is possible to detect the number keys or plus/minus when Ctrl is pressed.
I would consider switching to FreeGLUT if it helped work around this limitation.

I did a lot of research on this, and concluded it simply doesn't work.
For this reason, and other frustrations, we eventually ported our code from GLUT to SDL.

Related

Prevent application from warping/moving the mouse/cursor

My issue is KiCad related however it applies to other programs as well.
In KiCad under the schematics editor if you right click, move the mouse and then left-click the cursor will be placed back where you first right-clicked.
According to some answers (see launchpad below) this is not a bug it's a feature, so the developers are reluctant to make it an optional feature. There is a similar feature concerning warping the mouse when zooming in, which is optional.
My question is therefore if it is possible to block certain programs from moving the mouse cursor? i.e.
$ kicad --mousewarp=0
I have seen several requests for this on forums and as bug requests on launchpad:
https://forum.kicad.info/t/mouse-jumping-feature-removal/7077
https://bugs.launchpad.net/kicad/+bug/816739
Also a video on the issue at youtube:
https://www.youtube.com/watch?v=VtpipzDhyBY
An interesting observation is that if you select OpenGL in the pcb editor, the mouse does not warp, but there is no such alternative in the schematic editor.
Short answer: No.
The application sets the mouse cursor based on its needs. While this is annoying in the case you mention, it can be useful in others.
Long answer: Yes, but you may need to create your own input driver and ignore the XWarpPointer() calls.

How to add scrolling option on component parameter GUI?

I'm using Dymola but I expect OpenModelica might very well be the same (or at least similar).
For a given component model sometimes it makes more sense to have lots of parameters shown on one "tab" of the parameter GUI. This can lead to an excessively long GUI which, for many reasons including for psychological reasons in relation to how humans process information, is not a appropriate solution.
To solve this I would like to add a vertical scroll bar on the parameter GUI. I believe I saw it once though I cannot recall exactly where.
For illustrative purposes look to the right side of your web browser window. That gray bar that goes up and down is the scrollbar :). I know, obvious but you never know.
I assume I need to put some command in an annotation somewhere though where and what command I am not sure. For example, I found some reference to a verticalScrollBarPolicy but alas, I can not find any documentation on this.
Anyone know how to do this?
EDIT #1:
Dymola (and Adrian indicated OpenModelica as well) will automatically create the scroll bar when the GUI gets larger than the screen. Unfortunately (at least in Dymola) there is little margin so if you GUI is a fraction smaller than the window the "OK" button will be covered by the ribbon on the bottom of the screen and the GUI will be needed to made slightly larger to make the scroll bar appear automatically. This is a reason why a manual option for a scrollbar would come in handy.
I think additional "tabs" might help?
As far as I know in OpenModelica we have a scroll bar for that dialog windows if the window would expand out of the screen.
As of this posting my understanding based on feedback on this forum, my own experience, and from additional discussions with others there is no current manual control of the GUI (i.e., size, scrollbars, etc.).
Your best bet if you come across issues (e.g., you have a super small 2nd monitor) is to use lots of tabs and keep descriptions very short (which is probably appropriate for most applications anyways).
This is a Dymola and OpenModelica issue not a modelica issue as it is not contained in the modelica specification (as I understand it).
If this changes and I find out about it I'll remove or update this post.

Wiimote on PC with GlovePIE and Wiinremote

First off, I hope this is the right place to post this. I am new, and Stack Exchange was the first site I thought of for this question. After reading the "How to Ask" page here, I don't see a better place. Let me know if I'm missing something and there's a place more suited for this question.
My question here, with background info below: Does anyone know how to use only pitch and roll for a mouse in GlovePIE, without yaw and IR?
Background: basically, I want to use my wiimote for mouse + WASD for PC gaming, but I cannot use an IR sensor bar. (I am CADding around the wiimote for a project and this material will end up obstructing the signal.) I have at my disposal: an RVL-036 wiimote and a broadcomm bluetooth dongle with a hacked Toshiba stack, a used RVL-003 wiimote I bought when the 036 didn't pan out, Wiinremote, and GlovePIE.
GlovePIE doesn't work with the 036 wiimote, and neither does Wiinremote even though I expected it to. With the 003, Wiinremote gives me perfect mouse movement using pitch and roll (I hear yaw needs an IR sensor). The problem is: I can set keys in Wiinremote such as Up on the D-pad to W on the keyboard, Left to A, and Down to S, but they only work in web browsers and such and not in-game.
My focus is now on GlovePIE scripts because I hear it does a good job in-game getting wiimote buttons to act as keyboard keys. (I first tried lednerg's motionplus script, but obviously I get "motion plus NOT DETECTED" in the debug field. I can click with the script running, but I just can't pan the cursor around.) I have looked around for mouse scripts so that I can add my own WASD key assignments, but every script I have found uses an IR sensor bar. I know it must be possible to use only roll and pitch for a mouse in GlovePIE--because Wiinremote handles it beautifully--but I have unsuccessfully tried looking for wii-specific GlovePIE tutorials and I don't understand the general syntax or how to call on the wiimote in GlovePIE.
I basically want to do exactly what Wiinremote does but in GlovePIE in the hopes of getting keys to work in-game.
My question: does anyone know how to use only pitch and roll for a mouse or know how I can familiarize myself with GlovePIE's language to do it myself?
Thanks.
Thanks, nwk and Tim. I posted on Super User. But I think I just answered my own question anyway. I found a stupidly simple solution: run GlovePIE and Wiinremote simultaneously, GlovePIE for buttons and Wiinremote for the mouse. facepalm
GlovePIE's syntax seems simple enough from others' button assignment scripts, as long as I stay away from mouse scripting.

Can you think of some way to remove a button from a compiled vb6 application

We have a VB6 application running at a customer that has a bug in it when the user clicks on the Help button. A quick and easy fix would be to somehow remove the button so that they cannot click it (recompiling isn't an option btw). Possibly a separate app running that is constantly looking for this form and then somehow removing/hiding the button. Can anyone think of a way to do this?
You might be able to find the button window handle using the caption and maybe the class, and then disable it.
This would be pure unadulterated evil, and would sooner or later cause immense pain to you or (worse) an innocent colleague. You really should recompile the application, unless threatened by something worse than a velociraptor.

How does "Cinch App" do it?

If you aren't familiar with Cinch, its an application on Mac App Store that allows you to resize ANY window to half/full screen size if you drag the window to the edge of the screen. Exactly like the functionality in windows 7.
Now my question is, how is it done? I have looked all over cocoa apis looking for notifications/delegate methods for whenever a window is being dragged (ALL windows, not just windows owned by the app from which code is running from) but can't find it. Looked in Core Graphics API...Quartz Display Services....but can't find it.
Any help will be greatly appreciated as I have been looking for the past week....Thanks!
Edit: Resize the window is easy since it can be done through applescript bridge..
Are you developer behind i-Snap or some other Mac App Store clone of Cinch?
I'm the developer behind Cinch, and while I try to maintain an "abundance mentality" which basically says "There's enough out there for everyone", I've been upset by the Mac App Store lowering the barrier for entry to this market which has produced a number of half-backed competitors.
I would be thrilled to see some real innovation around the work I have done, and not just clones looking to make a quick buck.
Anyway, you want to look at the Accessibility APIs. It's a Carbon C API. This is probably your best reference: http://developer.apple.com/library/mac/#samplecode/UIElementInspector/Introduction/Intro.html%23//apple_ref/doc/uid/DTS10000728
I've not used the Cinch app, but if I were to do this I'd expect to be using cocoa events. (Also see here) Specifically the mouse handling events, combined with where the mouse is currently on-screen. They probably set a variable when a window is grabbed and then track the mouse pointer until it hits an edge or until they release the mouse button.
Events are very powerful and provide very low level access to what is happening, but can also be very complex. Good luck!
I'm not sure. Maybe the developers combine apple script and carbon events. You can create carbon events to know when the mouse has been clicked or dragged