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 


key press function In lua

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

Joined: 11 Mar 2016
Posts: 231

PostPosted: Mon Aug 22, 2016 8:30 am    Post subject: key press function In lua Reply with quote

I want to use left click button as hotkey for right click
without affecting left mouse button function
If VK_LBUTTON pressed then
press VK_RBUTTON

Iam new in lua how can I do that ?


Last edited by Twistedfate on Mon Aug 22, 2016 10:48 am; edited 1 time in total
Back to top
View user's profile Send private message
usernotfound
Expert Cheater
Reputation: 0

Joined: 21 Feb 2016
Posts: 115

PostPosted: Mon Aug 22, 2016 8:48 am    Post subject: Re: key press function In lua Reply with quote

Code:

hk = createHotkey(function() doKeyPress(VK_RBUTTON) end, VK_LBUTTON)
Back to top
View user's profile Send private message
Twistedfate
Expert Cheater
Reputation: 1

Joined: 11 Mar 2016
Posts: 231

PostPosted: Mon Aug 22, 2016 9:08 am    Post subject: Re: key press function In lua Reply with quote

Hiyaki wrote:
Code:

hk = createHotkey(function() doKeyPress(VK_RBUTTON) end, VK_LBUTTON)


didnot work sorry ! ( I want is to press right click with each left click )
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Mon Aug 22, 2016 9:36 am    Post subject: Reply with quote

I really really doubt this is what you want:
Code:

if (ce_swapmousebuttons==nil) then
  ce_swapmousebuttons=autoAssemble([[
registersymbol(ce_swapmousebuttons)
alloc(ce_swapmousebuttons, 4096)
ce_swapmousebuttons:
sub rsp, 20
call SwapMouseButton
add rsp,20
ret
]], true)
end

if (ce_swapmousebuttons) then
  executeCodeLocal("ce_swapmousebuttons", 1)
end



change 1 to 0 and execute to disable it

_________________
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
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Wed Aug 24, 2016 5:53 am    Post subject: Reply with quote

@TwistedFace,
Use this script (32 bit only atm)
http://forum.cheatengine.org/viewtopic.php?p=5688755#5688755

Then execute this

Code:
function DoRightClick()
   DoMouseClick(0,0,true,1)
   --[[
      -- DoMouseClick( x , y , relative , 1 = right click other than 1 is left click)
      X,Y are the location on screen
      if relative is true then X,Y are relative to mouse x,y
      
      in the script above it will basically do right click based on mouse positions, so x+0,y+0
      
      if 4th parameter is set to 1 then it will perform a right click instead of left click
   
   --]]
end

hk = createHotkey(DoRightClick, VK_LBUTTON)

_________________
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919
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