Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


On Losing Focus

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
.lua
Expert Cheater
Reputation: 1

Joined: 13 Sep 2018
Posts: 189

PostPosted: Sat Jun 15, 2019 7:49 am    Post subject: On Losing Focus Reply with quote

Code:
f=createForm()
p=createPanel(f)
p.caption='Focus control'
p.Visible=false
f.Onclick=function()
  p.Visible=true
end--getFocus()

I want to write a code that loses focus (hide the panel when I click outside the window)。I need a simple way (without creating hotkeys)
Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Sat Jun 15, 2019 10:26 am    Post subject: Reply with quote

Not sure what you mean with 'the window', I assumed it as the panel itself.

Code:
f=createForm()
p=createPanel(f)
p.caption='Focus control'
p.Visible=false
f.setFocus()

x=0
f.Onclick=function(sender)
  if(x==0)then
    p.Visible=true
    x=1
  else
    p.Visible=false
    x=0
  end
end

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
.lua
Expert Cheater
Reputation: 1

Joined: 13 Sep 2018
Posts: 189

PostPosted: Sat Jun 15, 2019 1:02 pm    Post subject: Reply with quote

Corroder wrote:
Not sure what you mean with 'the window', I assumed it as the panel itself.
Sorry, maybe I didn't make myself clear. I mean click on another form or desktop
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25288
Location: The netherlands

PostPosted: Sat Jun 15, 2019 3:50 pm    Post subject: Reply with quote

use a quick running timer in which you call getForegroundProcess()

if it's not your program, then do what you need to do

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
.lua
Expert Cheater
Reputation: 1

Joined: 13 Sep 2018
Posts: 189

PostPosted: Sat Jun 15, 2019 9:45 pm    Post subject: Reply with quote

Dark Byte wrote:
use a quick running timer in which you call getForegroundProcess()

if it's not your program, then do what you need to do
I found this in your cheating engine. I don't know how you did it. I just wanted to do it without using timers, threads, hotkeys, or any system resources.


Cheating Engine (Lost Focus).png
 Description:
 Filesize:  64.43 KB
 Viewed:  2896 Time(s)

Cheating Engine (Lost Focus).png


Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25288
Location: The netherlands

PostPosted: Sat Jun 15, 2019 10:33 pm    Post subject: Reply with quote

look at the generated code

and it uses a timer

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
.lua
Expert Cheater
Reputation: 1

Joined: 13 Sep 2018
Posts: 189

PostPosted: Sun Jun 16, 2019 4:25 am    Post subject: Reply with quote

Dark Byte wrote:
look at the generated code

and it uses a timer
I see,You used a timer.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites