problem in Webview with "Toogle Key sounds" Or "Key Sounds"

Mac OSX specific forum
User avatar
skinkairewalker
Enthusiast
Enthusiast
Posts: 782
Joined: Fri Dec 04, 2015 9:26 pm

problem in Webview with "Toogle Key sounds" Or "Key Sounds"

Post by skinkairewalker »

when I create a webview on my macbook, when I press keys on the keyboard, it keeps playing a dry sound until I stop pressing the keys, what could it be?

I think it calls ?: "Key Clicks" or "Toogle Key Sounds", on windows it is found in the accessibility section

I recorded a video : https://youtube.com/shorts/zPjMay06uIU

example :

Code: Select all

If OpenWindow(0, 0, 0, 960, 590, Webview MacOs", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_Invisible)
    WebGadget(0, 0, 0, 960, 590, "https://soqueto.com/game3/")
    CocoaMessage(0, CocoaMessage(0, GadgetID(0), "preferences"), "setJavaScriptEnabled:", #YES)
    CocoaMessage(0, CocoaMessage(0, GadgetID(0), "preferences"), "setWebSecurityEnabled:", #NO)
    Define scrollView = CocoaMessage(0, GadgetID(0), "enclosingScrollView")
    CocoaMessage(@test, scrollView, "setVerticalScrollElasticity:", #NSScrollElasticityNone)
    CocoaMessage(@test, scrollView, "setHorizontalScrollElasticity:", #NSScrollElasticityNone)
    SetGadgetAttribute(0, #PB_Web_BlockPopupMenu, #True)
    SetGadgetAttribute(0, #PB_Web_BlockPopups, #True)

    StickyWindow(0, #True) : HideWindow(0, #False)
    Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Does anyone know how to solve this without having to disable it in the operating system settings?
User avatar
skinkairewalker
Enthusiast
Enthusiast
Posts: 782
Joined: Fri Dec 04, 2015 9:26 pm

Re: problem in Webview with "Toogle Key sounds" Or "Key Sounds"

Post by skinkairewalker »

prevent the beep using this : viewtopic.php?p=453973&hilit=keyboard+beep#p453973

precisely, using this code:

Code: Select all

ProcedureC PerformKeyEquivalent(Sender, sel, event)
  
  Static lastEvent
  Protected currentevent = event
   Protected result = #YES  
   If currentEvent = lastEvent : ProcedureReturn result : EndIf
   lastEvent = currentEvent

;    If currentEvent
;       Select CocoaMessage(0, currentEvent, "type")
;          Case #NSKeyDown
;             Debug "KeyDown : keyCode = " + CocoaMessage(0, currentEvent, "keyCode")
;             Define Long = CocoaMessage(0, currentEvent, "characters")
;             CocoaMessage(@Long, Long, "UTF8String")
;             Debug "KeyDown : keyChar = " + Asc(PeekS(Long, -1, #PB_UTF8))
;          
;          Case #NSKeyUp
;             Debug "KeyUp : keyCode = " + CocoaMessage(0, currentEvent, "keyCode")
;          
;      ;    Case #NSFlagsChanged ; SHIFT, CMD, ALT, CTRL, CAPS
;      ;       Debug "Flags : " + Bin(CocoaMessage(0, currentEvent, "modifierFlags"))
;          
;       EndSelect
;     EndIf
  
  ProcedureReturn #NO 
EndProcedure
User avatar
skinkairewalker
Enthusiast
Enthusiast
Posts: 782
Joined: Fri Dec 04, 2015 9:26 pm

Re: problem in Webview with "Toogle Key sounds" Or "Key Sounds"

Post by skinkairewalker »

but that led to another problem...
now operating system shortcuts are activated, for example : CTRL + DOWN or CTRL + UP all ( these 2 commands open all open windows on the desktop )


does anyone know how i prevent the operating system shortcuts and focus only on the webview itself?
Post Reply