Forum > FV/Textmode IDE
Terminal mouse support in MacOS/NOGPM unix
(1/1)
Dmitry24:
I was porting my app to MacOS terminal and found no mouse support (unlike Linux terminal). After some modification of the sources files I was able to turn the mouse support on. I'm not sure if it should be reported to the bugtracker or somewhere else.
In mouse.pp I found out the support was turned off by the instructions
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---{$if defined(aix) or defined(bsd) or defined(solaris)}{$define NOMOUSE}{$endif}
For me it looked that GPM was not supported in MacOS terminal but mouse terminal sequences was supported through the Keyboard unit. So I just changed the above define NOMOUSE to NOGPM (actually I used a bit different way not to recompile FPC units but the sense it the same):
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---{$define NOGPM}
And additionally I called InitMouse procedure disregarding the DetectMouse result (which is default behaviour in the Drivers unit where InitMouse is called only for non-zero ButtonCount = DetectMouse, but DetectMouse returns zero w/o GPM support).
These simple changes turned mouse macOS terminal support on through the use of Keyboard unit which processes mouse special sequences.
Can someone answer if there is any reason for no mouse support on macOS terminal by default? Should this be reported as a bug or improvement request? Should also this way be used to remove the GPM usage on Linux (as I read in gpm.pp file itself the gpm should be abolished ASAP)?
marcov:
Originally this was mainly for mouse in console. Physical textmode console, not terminals.
However it is possible that it is wrong, and should be more detailed for support in visual consoles. (using what I assume are XTERM escape sequences).
But since then you have two possible situations (real console using GPM/sysmouse) and terminal windows using XTerm escape sequences, that should probably be runtime and not compiletime.
So the situation is not very clear, but filing a bug that something is not right seems prudent.
At the very least the (bsd) should be invidiualized per bsd defining target (free/open/net/darwin).
Navigation
[0] Message Index