Recent

Author Topic: Beeps on keypress  (Read 1991 times)

dbannon

  • Hero Member
  • *****
  • Posts: 2797
    • tomboy-ng, a rewrite of the classic Tomboy
Beeps on keypress
« on: December 24, 2018, 12:54:08 am »
This problem is probably very specific to me, it depends on KControls on Cocoa and I don't expect too many readers will have KControls installed.  But I'm hoping for some general advice that might help me track it down.

Using (Fixes_2_0) cocoa any key press that shows a visible character (ie, not a space, ctrl-char, delete key etc) into KMemo produces a 'bonk' sound. Mac seems to do it elsewhere as some sort of acknowledgement but very annoying when just typing away. Cocoa (and Linux/Windows) does not do it.

I traced a keypress as far as CocoaPrivate.pas, line #652 where inherited keyDown(event) is called -
Code: Pascal  [Select][+][-]
  1. procedure TCocoaCustomControl.keyDown(event: NSEvent);
  2. begin
  3.    if not Assigned(callback) or not callback.KeyEvent(event) then
  4.     inherited keyDown(event);
  5. end;
     

Its not a case that the inherited function should not be called, commenting it out prevents the keystroke form appearing at all. Now, TCocoaCustomControl is a declared like this -

Code: Pascal  [Select][+][-]
  1. TCocoaCustomControl = objcclass(NSControl)

and NSControl is declared in the fpc rtl in NSControl.inc   As its in FPC code rather than LCL, no debugging and I've had to stop there.  I did look in NSControl.inc, it declares what looks like bindings to the apple libraries to my uneducated gaze.

So, either the 'bonk' is caused by something in NSControl (unlikely) or its subsequently calls something, perhaps back in KControls that generates this annoying noise.

Can anyone suggest another approach to this issue ?

(Don't hesitate to suggest something obvious, I am not at all a comfortable Mac user !)

Davo 
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

 

TinyPortal © 2005-2018