Jump to content


Photo

[Help] Focus the Renoise window from the tool window.

focus renoise window

  • Please log in to reply
9 replies to this topic

#1 Raul (ulneiz)

Raul (ulneiz)

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1543 posts
  • Gender:Male
  • Location:Spain

Posted 24 July 2017 - 10:47

I have a tool with a window. I have been looking at this documentation. Is there any way to focus the Renoise window from the tool window?

 

Doc info:

-------- Functions

-- Expand the window over the entire screen, without hiding menu bars, 
-- docks and so on.
renoise.app().window:maximize()

-- Minimize the window to the dock or taskbar, depending on the OS.
renoise.app().window:minimize()

-- "un-maximize" or "un-minimize" the window, or just bring it to front.
renoise.app().window:restore()

-- Select/enable one of the global view presets, to memorize/restore
-- the user interface 'layout'.
renoise.app().window:select_preset(preset_index) 

.....etc

Something like that renoise.app().window:focus() ??? (focus the window of renoise)
 
What I intend to build is the idea and turn between the window of renoise and the window of the tool, without having to close the tool, through keyboard commands.
 
The round-and-turn between windows using keyboard commands makes it easier to use a tool. The goal is to not have to close the tool to return to the Renoise window and that the tool window remains in the foreground.
 
Is there any way?
 
Thanks!

:excl: Development of my tools: KangarooX120SamRenderPhraseTouch  |  GT16-Colors (old)

 

:excl: My API wishlist R3.1 (updated 24 July 2017):

Spoiler

 

:excl: My Renoise 3.1 wishlist (updated 26 September 2017):

Spoiler

#2 esaruoho

esaruoho

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 2678 posts
  • Gender:Male
  • Location:Kontula, Helsinki, Finland
  • Interests://Varying Interests//

Posted 11 January 2018 - 18:59

The round-and-turn between windows using keyboard commands makes it easier to use a tool. The goal is to not have to close the tool to return to the Renoise window and that the tool window remains in the foreground.

What does 

renoise.app().window.lock_keyboard_focus

do? I'm not very well versed with LUA GUI Windows. 

 

 

Anyway, forget lock_keyboard_focus, and check this out:

 

Ok, I opened NoodleTrap. I pressed F2 (which for me is "go to Pattern Editor") The focus is now on Pattern Editor. Now I press another key to open up NoodleTrap - but because it is open, now the focus is on the GUI window.

 

Is this what you're looking for?


http://lackluster.org | on Bandcamp | on YouTube | on Facebook | on Spotify | on iTunes | on TiDAL | on Soundcloud | 

http://twitter.com/esaruoho | http://esaruoho.tumblr.com | GitHubesaruoho@gmail.com | 

| macOS 10.13 High Sierra | MacBook Pro 2.8 GHz Intel Core i7 / 16 Gb 1600 MHz DDR 3 |

| http://renoise.com/tools/paketti | BTC: 1BoZ9rvb8wT7dFNyVPwSX7DLj3stNo7844 | http://paypal.me/esaruoho |

| Latent Impulse Tracker/Scream Tracker 3/Schism Tracker <-> Renoise fanatic |

More API functions, please! ;) http://forum.renoise.com/index.php/topic/26329-the-api-wishlist-thread/page-3#entry240266

#3 Ledger

Ledger

    Guruh Motha Fakka Knows More About Renoise Than Taktik

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 3645 posts
  • Gender:Male

Posted 11 January 2018 - 19:21

Not sure if this helps but it is from my default tool setup.  It means that when the tool gui is open, all the keys get passed back to renoise via the keyhandler function. i.e. return key on line 8.
 
The renoise.app().window.lock_keyboard_focus is toggled  twice so that the users lock focus preference is not overridden, but you still get the side effect of the pattern editor being focused with each key press (each time the function runs).
 
This setup passes all keystrokes to renoise all the time, but you could limit it using some sort of global flag and checkbox notifier (a kind of edit mode).  Or some key combination to set that global flag. 
 
      --------------
      --key Handler
      --------------
      local function my_keyhandler_func(dialog,key)
         --toggle lock focus hack, allows pattern ed to get key input
         renoise.app().window.lock_keyboard_focus = not renoise.app().window.lock_keyboard_focus
         renoise.app().window.lock_keyboard_focus = not renoise.app().window.lock_keyboard_focus
         return key
      end
     
     
      ------------------------------------------------------------------------------------------
      --Script dialog
      ------------------------------------------------------------------------------------------
      my_dialog = renoise.app():show_custom_dialog(
          TOOL_NAME, dialog_content,my_keyhandler_func)
---------------------


Also key is a table with the 5 entries:
 
key.character
key.modifiers
key.name
key.note
key.repeated


Here is a printout in the terminal: rprint(key) --after the `r` key has been pressed by user on the qwerty keyboard: 
 
--rprint() recursively prints the table: key 
rprint(key)
[character] => r
[modifiers] =>
[name] => r
[note] => 17
[repeated] => false
so if you wanted to do something with a specific key the user presses, you can do something like this:
 
If key.character == "r" then
  -- do something here
end
if using a flag then it would be something like this:
If (key.character == "r") and (my_global_flag == true) then  
  -- do something here
end

Edited by Ledger, 14 January 2018 - 05:49.

  • esaruoho likes this

--> Lua for newbies <--

My Scripts On Forum

Top Tip!

 

cpu : Xeon 1231 v3, os : Win 7 64bit, audio: Audient iD4
posts as 4tune @ KvR and some other music related sites


#4 esaruoho

esaruoho

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 2678 posts
  • Gender:Male
  • Location:Kontula, Helsinki, Finland
  • Interests://Varying Interests//

Posted 11 January 2018 - 20:23

Ledger, could this be used to make it so that "Esc" would escape into pattern editor (edit mode on/off) and _not_ _ever_ close the sample recorder dialog? Cos I'm finding it damn difficult to track with edit mode on/off while sampling, without losing the sample.


http://lackluster.org | on Bandcamp | on YouTube | on Facebook | on Spotify | on iTunes | on TiDAL | on Soundcloud | 

http://twitter.com/esaruoho | http://esaruoho.tumblr.com | GitHubesaruoho@gmail.com | 

| macOS 10.13 High Sierra | MacBook Pro 2.8 GHz Intel Core i7 / 16 Gb 1600 MHz DDR 3 |

| http://renoise.com/tools/paketti | BTC: 1BoZ9rvb8wT7dFNyVPwSX7DLj3stNo7844 | http://paypal.me/esaruoho |

| Latent Impulse Tracker/Scream Tracker 3/Schism Tracker <-> Renoise fanatic |

More API functions, please! ;) http://forum.renoise.com/index.php/topic/26329-the-api-wishlist-thread/page-3#entry240266

#5 Raul (ulneiz)

Raul (ulneiz)

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1543 posts
  • Gender:Male
  • Location:Spain

Posted 11 January 2018 - 20:34

renoise.ApplicationWindow.MIDDLE_FRAME_PATTERN_EDITOR
renoise.ApplicationWindow.MIDDLE_FRAME_MIXER
renoise.ApplicationWindow.MIDDLE_FRAME_INSTRUMENT_PHRASE_EDITOR
renoise.ApplicationWindow.MIDDLE_FRAME_INSTRUMENT_SAMPLE_KEYZONES
renoise.ApplicationWindow.MIDDLE_FRAME_INSTRUMENT_SAMPLE_EDITOR
renoise.ApplicationWindow.MIDDLE_FRAME_INSTRUMENT_SAMPLE_MODULATION
renoise.ApplicationWindow.MIDDLE_FRAME_INSTRUMENT_SAMPLE_EFFECTS
renoise.ApplicationWindow.MIDDLE_FRAME_INSTRUMENT_PLUGIN_EDITOR
renoise.ApplicationWindow.MIDDLE_FRAME_INSTRUMENT_MIDI_EDITOR

-- When true, the middle frame views (like the pattern editor) will stay focused unless alt or middle mouse is clicked. renoise.app().window.lock_keyboard_focus -> [boolean]

I do not know how this works. I'll have to try it.


Edited by Raul (ulneiz), 11 January 2018 - 20:34.

:excl: Development of my tools: KangarooX120SamRenderPhraseTouch  |  GT16-Colors (old)

 

:excl: My API wishlist R3.1 (updated 24 July 2017):

Spoiler

 

:excl: My Renoise 3.1 wishlist (updated 26 September 2017):

Spoiler

#6 Ledger

Ledger

    Guruh Motha Fakka Knows More About Renoise Than Taktik

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 3645 posts
  • Gender:Male

Posted 11 January 2018 - 20:39

Ledger, could this be used to make it so that "Esc" would escape into pattern editor (edit mode on/off) and _not_ _ever_ close the sample recorder dialog? Cos I'm finding it damn difficult to track with edit mode on/off while sampling, without losing the sample.

 
If you want to stop keys getting back to renoise, you would have to have a dialog open all the time and it would need to be focused, so I don`t think there would be a practical solution there..

renoise.ApplicationWindow.MIDDLE_FRAME_PATTERN_EDITOR
renoise.ApplicationWindow.MIDDLE_FRAME_MIXER
renoise.ApplicationWindow.MIDDLE_FRAME_INSTRUMENT_PHRASE_EDITOR
renoise.ApplicationWindow.MIDDLE_FRAME_INSTRUMENT_SAMPLE_KEYZONES
renoise.ApplicationWindow.MIDDLE_FRAME_INSTRUMENT_SAMPLE_EDITOR
renoise.ApplicationWindow.MIDDLE_FRAME_INSTRUMENT_SAMPLE_MODULATION
renoise.ApplicationWindow.MIDDLE_FRAME_INSTRUMENT_SAMPLE_EFFECTS
renoise.ApplicationWindow.MIDDLE_FRAME_INSTRUMENT_PLUGIN_EDITOR
renoise.ApplicationWindow.MIDDLE_FRAME_INSTRUMENT_MIDI_EDITOR

-- When true, the middle frame views (like the pattern editor) will stay focused unless alt or middle mouse is clicked. renoise.app().window.lock_keyboard_focus -> [boolean]
I do not know how this works. I'll have to try it.

 
clue: :)
renoise.app().window.active_middle_frame = renoise.ApplicationWindow.MIDDLE_FRAME_INSTRUMENT_SAMPLE_MODULATION
Also the lock keyboard focus is the same as the user preference in renoise under the View menu (second entry down)

Edited by Ledger, 11 January 2018 - 20:42.

--> Lua for newbies <--

My Scripts On Forum

Top Tip!

 

cpu : Xeon 1231 v3, os : Win 7 64bit, audio: Audient iD4
posts as 4tune @ KvR and some other music related sites


#7 esaruoho

esaruoho

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 2678 posts
  • Gender:Male
  • Location:Kontula, Helsinki, Finland
  • Interests://Varying Interests//

Posted 11 January 2018 - 20:55

Also the lock keyboard focus is the same as the user preference in renoise under the View menu (second entry down)

 

Please tell me more about this - i just disabled View->Lock Keyboard Focus, and now each click to Instrument Box or Disk Browser or Pattern Editor automatically takes the keyboard focus. could I do a script that switches between where the keyboard focus is in? Like, could I toggle "keyboard focus in instrument box" or "in pattern editor" or.. "in disk browser"? would be wonderful!


http://lackluster.org | on Bandcamp | on YouTube | on Facebook | on Spotify | on iTunes | on TiDAL | on Soundcloud | 

http://twitter.com/esaruoho | http://esaruoho.tumblr.com | GitHubesaruoho@gmail.com | 

| macOS 10.13 High Sierra | MacBook Pro 2.8 GHz Intel Core i7 / 16 Gb 1600 MHz DDR 3 |

| http://renoise.com/tools/paketti | BTC: 1BoZ9rvb8wT7dFNyVPwSX7DLj3stNo7844 | http://paypal.me/esaruoho |

| Latent Impulse Tracker/Scream Tracker 3/Schism Tracker <-> Renoise fanatic |

More API functions, please! ;) http://forum.renoise.com/index.php/topic/26329-the-api-wishlist-thread/page-3#entry240266

#8 Raul (ulneiz)

Raul (ulneiz)

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1543 posts
  • Gender:Male
  • Location:Spain

Posted 11 January 2018 - 21:12

Please tell me more about this - i just disabled View->Lock Keyboard Focus, and now each click to Instrument Box or Disk Browser or Pattern Editor automatically takes the keyboard focus. could I do a script that switches between where the keyboard focus is in? Like, could I toggle "keyboard focus in instrument box" or "in pattern editor" or.. "in disk browser"? would be wonderful!

--show automation editor
function vpd_aut_show_ae()
  --[[
  if renoise.app().window.active_lower_frame ~= renoise.ApplicationWindow.LOWER_FRAME_TRACK_AUTOMATION then
    renoise.app().window.active_lower_frame = renoise.ApplicationWindow.LOWER_FRAME_TRACK_AUTOMATION
  end
  ]]
  
  if ( renoise.app().window.lower_frame_is_visible == false ) then
    renoise.app().window.lower_frame_is_visible = true
  end
  renoise.app().window.active_lower_frame = renoise.ApplicationWindow.LOWER_FRAME_TRACK_AUTOMATION
end

This is to focus the automation editor. You can take it as an example for other areas. First you check if the area is visible or not. Then direct it there.

 

EDIT: Sorry, I think that is not enough. This only shows the window, but it does not focus. I have the same problem related to the approach. That from the tool, when executing a function with a button, it shows the desired area, and also the focus. It is one thing to show the area, and another thing is to mark the focus.

 

EDIT2: The case is: how to mark the focus? There should be some form, adding it at the end of the function, for the focus.


Edited by Raul (ulneiz), 11 January 2018 - 21:23.

  • Ledger and esaruoho like this

:excl: Development of my tools: KangarooX120SamRenderPhraseTouch  |  GT16-Colors (old)

 

:excl: My API wishlist R3.1 (updated 24 July 2017):

Spoiler

 

:excl: My Renoise 3.1 wishlist (updated 26 September 2017):

Spoiler

#9 Ledger

Ledger

    Guruh Motha Fakka Knows More About Renoise Than Taktik

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 3645 posts
  • Gender:Male

Posted 11 January 2018 - 21:55

Yes I think Raul`s right , there is no current way to set the focus, just the ability to set the user lock mode.

Edited by Ledger, 11 January 2018 - 21:58.

--> Lua for newbies <--

My Scripts On Forum

Top Tip!

 

cpu : Xeon 1231 v3, os : Win 7 64bit, audio: Audient iD4
posts as 4tune @ KvR and some other music related sites


#10 esaruoho

esaruoho

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 2678 posts
  • Gender:Male
  • Location:Kontula, Helsinki, Finland
  • Interests://Varying Interests//

Posted 11 January 2018 - 22:09

EDIT2: The case is: how to mark the focus? There should be some form, adding it at the end of the function, for the focus.

Thu Jan 11 23:08:25 ~ >> sol focus
-- stay focused unless alt or middle mouse is clicked.
renoise.app().window.lock_keyboard_focus
-- Invoked as soon as the application looses focus and another app
-- because your dialog will steal the focus from all other Renoise views such as
-- rather only after editing is complete (return is pressed, or focus is lost).
-- True when the text field is focused. setting the edit_mode programatically
-- will focus the text field or remove the focus (focus the dialog) accordingly.
-- True when the text field is focused. setting the edit_mode programatically
-- will focus the text field or remove the focus (focus the dialog) accordingly.

unfortunately the renoise api only allows for lock_keyboard_focus which does not seem to have anything interesting to do with the features we want :o

 

same with

Thu Jan 11 23:08:28 ~ >> sol browser
-- Opens the default internet browser with the given URL. The URL can also be
-- a file that browsers can open (like xml, html files...).
-- Opens the default file browser (explorer, finder...) with the given path.
-- Diskbrowser Panel.
renoise.app().window.disk_browser_is_visible, _observable
+ "Disk Browser Directories"
+ "Disk Browser Files"
> "Global", "Automation", "Disk Browser", "Instrument Box", "Mixer",
types will show up in Renoise's disk browser and can also be loaded by drag and 
  + ["category"] = in which disk browser category the file type shows up. 

there simply isn't something to bring focus to disk browser, or to make it selected. ohwell.


http://lackluster.org | on Bandcamp | on YouTube | on Facebook | on Spotify | on iTunes | on TiDAL | on Soundcloud | 

http://twitter.com/esaruoho | http://esaruoho.tumblr.com | GitHubesaruoho@gmail.com | 

| macOS 10.13 High Sierra | MacBook Pro 2.8 GHz Intel Core i7 / 16 Gb 1600 MHz DDR 3 |

| http://renoise.com/tools/paketti | BTC: 1BoZ9rvb8wT7dFNyVPwSX7DLj3stNo7844 | http://paypal.me/esaruoho |

| Latent Impulse Tracker/Scream Tracker 3/Schism Tracker <-> Renoise fanatic |

More API functions, please! ;) http://forum.renoise.com/index.php/topic/26329-the-api-wishlist-thread/page-3#entry240266