This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: [QUESTION] Help with mouselook and keybindings  (Read 2945 times)

thesixth

  • Registred Member
  • Race Changer
  • *****
  • Posts: 36
    • View Profile
[QUESTION] Help with mouselook and keybindings
« on: December 06, 2011, 03:04:52 pm »
Hi!
I'd like to re-map the controls of wow to get more of an "FPS"-feeling but I'm having some problems with this. This might be a little long since the material in the Spoiler is basically a log of my investigation around this. I have a mouselook-macro there that I find useful. Read if you are interrested, otherwise you can just scroll pass it.

[spoiler:yjrvu1eq]So...By opening the keybinding options in-game, one would notice a few of the basic bindings missing.
The missing binding in context is the right mousebutton which activates a "mouselook", or attacks/loots if something close is targeted.
The function bound to the second mouse button is called "TURNORACTION".

As I said earlier, this function is not present for custom keybing via the Keybindings-menu. In addition, it is not present in the file: "..//World of Warcraft//WTF//Account//accountname//bindings-cache.WTF".
This binding can be added to "binings-cache.WTF" and the line for it would be:
Code: [Select]
bind BUTTON2 TURNORACTION(This way, one can map the function from BUTTON2 to a different key if that is of interrest.)

However, by default, the TURNORACTION function is off untill the right mousebutton, or BUTTON2, is pressed. Without the button being pressed, the "mouselook" function is inactive, which means that by moving the mouse, I'm moving the cursor on the screen.
I would rather have it the other way around, so that "mouselook" is active by default, and only while holding down a modifyer like SHIFT or something, the cursor becomes active.

I'd like to switch place between the states of "default mouse-function" and the TURNORACTION function. The problem is, I do not know how to do this. There probably isn't a function to bind, equavilent of this "default mouse-function", sice TURNORACTION is only active while the button is pressed down, hence, the function deactivates and reverts back to "default mouse-function" once the right mouse button is released.


At: http://www.wowwiki.com/World_of_Warcraft_API - I stumbeled upon a few WoW API functions of interrest.
Take a look at theese:
    IsMouselooking() - Returns 1 if mouselook is currently active, nil otherwise.
    MouselookStart() - Enters mouse look mode; mouse movement is used to adjust movement/facing direction.
    MouselookStop() - Exits mouse look mode; mouse movement is used to move the mouse cursor.

I tested theese API's simply by creating a macro in wow that consisted of the following:
Code: [Select]
/run if IsMouselooking() then MouselookStop() else MouselookStart() endBy activating this macro, I found the somewhat desired effect: Wow in mouselook mode, independent of holding the activator (BUTTON2) pressed down. In other words, the macro toggles Mouselook on/off.

//////////////////////////// NOTE ON MACRO ////////////////////////////
If you found the previous macro interresting, try this instead:
Create a Macro, call it "Mouselook" without the ".
Code: [Select]
/script SetBindingMacro("SHIFT-BUTTON2","Mouselook");
/run if IsMouselooking() then MouselookStop() else MouselookStart() end
This macro sets shift+right mousebutton to toggle mouselook on/off, however you will be unable to interract with things, like looting, attacking, talking to npc's etc while holding the shift-key. If you wish to use this, then you will need to click this macro once, only once and then no more. Do this: You can drag your newly created "Mouselook" macro out to your actionbar, click it, right click anywhere (to get out of mouselook mode), and then remove it from your actionbar (you won't need it there anymore since it's bound to trigger by holding shift and clicking the right mousebutton).
I use this when playing on the real, blizzard WoW servers.
///////////////////////////////////////////////////////////////////////////////////////

Anyway, so far so good.[/spoiler:yjrvu1eq]


Again, at: http://www.wowwiki.com/World_of_Warcraft_API - I stumbeled upon a few WoW API functions of interrest.
Take a look at theese:
IsMouselooking() - Returns 1 if mouselook is currently active, nil otherwise.
MouselookStart() - Enters mouse look mode; mouse movement is used to adjust movement/facing direction.
MouselookStop() - Exits mouse look mode; mouse movement is used to move the mouse cursor.

I seriously don't want to use a macro for this function, just for the sake of it being a macro.
I suppose that "MouselookStart()" can be set to launch via "..//World of Warcraft//WTF//config.WTF", though, haven't tested that yet. Because, theoretically, there's probably a CVar related to this API somewhere to set mouselook to be activated by default when loading wow.

Anyway, to My Question :
How can I have Mouselook always ON by default, but by useing a modifyer like holding SHIFT or CTRL to disable mouselook, thus enabeling the cursor for interaction? I'm not looking for a "toggle"-solution, in fact, I'd like to have an "OnKeyDown"-kinda function for this.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
0===];;;;;;;;::::> [size=50] I am a swedish. Please execute me, my english is no very, very good.[/size]

thesixth

  • Registred Member
  • Race Changer
  • *****
  • Posts: 36
    • View Profile
Re: [QUESTION] Help with mouselook and keybindings
« Reply #1 on: December 06, 2011, 03:13:18 pm »
I think more people feel like me when controlling wow.
Have a look at this:

http://www.wowinterface.com/downloads/i ... kLock.html

Though, I want it in wow default, not in an addon :P
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
0===];;;;;;;;::::> [size=50] I am a swedish. Please execute me, my english is no very, very good.[/size]

Steff

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 4551
    • View Profile
Re: [QUESTION] Help with mouselook and keybindings
« Reply #2 on: December 07, 2011, 10:07:33 am »
You should implemente this as taggle. So guys(like me) that dont like it can turn of.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
Please mark as solved if solved.
Don't ask if you could ask a question... JUST ask the Question.
You can send me also offline messages. I will answer if I get online.
Skype: project.modcraft
Discord: steff#6954

thesixth

  • Registred Member
  • Race Changer
  • *****
  • Posts: 36
    • View Profile
Re: [QUESTION] Help with mouselook and keybindings
« Reply #3 on: December 07, 2011, 02:16:06 pm »
The plan is to make a little more options in customizing the controls. I agree this type of control-style should be optional.
To be honest, that add-on I linked to pretty much has everything I was trying to do, except the option for inverted mouse when useing mouselook. Looking at the coding helped me out allot.
Theese kind of controls should be toggled and customized from the game options-menu.

I think I'll be working with recoding this add-on instead, now that I have a fairly good base layed out to build upon. Saves some time.

By the way, once I'm done with it - does anyone have an idea on how to include my final "addon" in the clientside "Patch-x.MPQ" and how to *Not have it listed as an add-on but rather concidered part of the client-side UI?
« Last Edit: January 01, 1970, 01:00:00 am by Admin »
0===];;;;;;;;::::> [size=50] I am a swedish. Please execute me, my english is no very, very good.[/size]

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [QUESTION] Help with mouselook and keybindings
« Reply #4 on: December 07, 2011, 02:50:12 pm »
Include it in Interface/Addons/FrameXML in locale-**.MPQ.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »