Recent

Author Topic: [SOLVED] Mac application can not accept key stroke  (Read 2013 times)

FangQ

  • Full Member
  • ***
  • Posts: 134
[SOLVED] Mac application can not accept key stroke
« on: August 18, 2017, 10:32:50 pm »
my lazarus program stopped working on the Mac (probably for a while). I notice that it does not accept key strokes in a modal window, whatever I type will show in the terminal in which I started the executable. Pressing enter simply add a line in the terminal. The modal window can neither closed, cancelled, or moved. It does not even get focus.

In the command line, I see two "TCarbonButton.SetFocus Error". a screenshot is attached.

I imagine that typing in a field is the most basic feature in any app, and curious if it works on your mac application? my lazarus is 1.6, and the Mac OS is 10.12.

let me know if there is a workaround. thanks

Update [08/20/2017]: as suggested by others, I created application bundle, and was able to run the app using the app bundle.
« Last Edit: August 20, 2017, 08:59:41 pm by FangQ »

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Mac application can not accept key stroke
« Reply #1 on: August 18, 2017, 10:50:37 pm »
I imagine that typing in a field is the most basic feature in any app, and curious if it works on your mac application? my lazarus is 1.6, and the Mac OS is 10.12.

Run the program's app bundle (.app) not the executable.


FangQ

  • Full Member
  • ***
  • Posts: 134
Re: Mac application can not accept key stroke
« Reply #2 on: August 19, 2017, 12:18:15 am »
Run the program's app bundle (.app) not the executable.

thank you for your reply. I double click on the .app file inside the debug folder (same as the binary), I got an error.

if you want to reproduce this, my code is available online at https://github.com/fangq/mcx/tree/master/mcxstudio
you can check out using git clone https://github.com/fangq/mcx.git and compile the mcxstudio.lpi under the mcxstudio folder.

FangQ

  • Full Member
  • ***
  • Posts: 134
Re: Mac application can not accept key stroke
« Reply #3 on: August 20, 2017, 09:00:12 pm »
Run the program's app bundle (.app) not the executable.

thank you Phil, I figured it out. running via the app bundle solved the problem!

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Mac application can not accept key stroke
« Reply #4 on: August 20, 2017, 09:02:19 pm »
Run the program's app bundle (.app) not the executable.

thank you Phil, I figured it out. running via the app bundle solved the problem!

Good to hear.

Apps on Mac are always .app bundles, which are actually just folders.

 

TinyPortal © 2005-2018