Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: Is there a way to...

  1. #11
    Join Date
    Jan 2006
    Posts
    29

    Default

    Hello,

    Well I have tried playing around with several of the lines of code that you gave me (including the one you just mentioned), like changing the 1024 number, the LEFT to RIGHT, the numbers 1,2, just to see what would happen anyway, but I still can't get it to work right. I found a temporary way to get the effects I need:

    Code:
    local TvStatus= monitor.GetDisplayMode(2) 
    
    print (TvStatus) 
    
    if TvStatus == nil then 
    monitor.EnableMonitor(2, 1024, 0) 
    
    monitor.SwapPrimaryMonitor(1, 2, monitor.LEFT )
    monitor.DisableMonitor(1)
    
    end 
    
    if TvStatus == 800 then 
    monitor.SwapPrimaryMonitor(2, 1, monitor.LEFT ) 
    
    monitor.DisableMonitor(2) 
    end
    This moves my desktop entirely to my TV and just shuts off my monitor, which is fine I guess. I tried it once or twice and I thought I had it working, but just last night I took the LCD away and replaced it with a small CRT (since it just sits in my closet, it's a waste of a good monitor...the LCD that is), and when I tried running that script, it seems to be acting funny. Maybe since the resolution is different, i guess I'll have to check that. But as long as I can get it to work, I guess I'll be ok. It's just that it bugs me that this is happening when it seems like it shouldn't, since I can do what I need to do manually through the display settings, you know?

    thanks,
    Jamie

  2. #12
    Join Date
    Dec 2001
    Posts
    11,560

    Default

    can you add this code at the end of your script

    monitor.GetDesktopMonitors ()

    for i,m in ipairs (monitor.Monitors) do

    for k,v in pairs (m) do
    print (k,v)
    end

    end

  3. #13
    Join Date
    Jan 2006
    Posts
    29

    Default

    Mike,

    I added the script you wanted me to add to the end of my script, and ran it a couple of times, but I haven't noticed anything different...is it supposed to do something extra?

    thanks,
    jamie

  4. #14
    Join Date
    Dec 2001
    Posts
    11,560

    Default

    i was curious what the output to the lua console was - if that gives a clues to the problem...

  5. #15
    Join Date
    Jul 2005
    Location
    Uithuizen, The Netherlands
    Posts
    576

    Default

    hi,

    This moves my desktop entirely to my TV and just shuts off my monitor, which is fine I guess. I tried it once or twice and I thought I had it working, but just last night I took the LCD away and replaced it with a small CRT (since it just sits in my closet, it's a waste of a good monitor...the LCD that is), and when I tried running that script, it seems to be acting funny. Maybe since the resolution is different,
    a different resolution will certainly change the script, a little example:

    this code is for a setup with monitors 1@1024x768 and 2 @800x600

    Code:
    local TvStatus= monitor.GetDisplayMode(2)
    
    print (TvStatus)
    
    if TvStatus == nil then
    monitor.EnableMonitor(2, 1024, 0)
    monitor.SwapPrimaryMonitor(1, 2, monitor.LEFT )
    monitor.DisableMonitor(1)
    end
    
    [code]if TvStatus == 800 then[/code]
    monitor.SwapPrimaryMonitor(2, 1, monitor.LEFT )
    monitor.DisableMonitor(2)
    end
    if the first monitor is a monitor @800x600
    Code:
    monitor.EnableMonitor(2, 1024, 0)
    becomes
    Code:
    monitor.EnableMonitor(2, 800, 0)
    if the second monitor is a monitor @1024x768
    Code:
    if TvStatus == 800 then
    becomes
    Code:
    if TvStatus == 1024 then
    so change the script according to your new setup.

    hope this helps :wink:

  6. #16
    Join Date
    Jan 2006
    Posts
    29

    Default

    Thanks blubberford,

    It turns out that I have the exact setup that you mentioned in your first block of code (1@1024x768 and 2 @800x600), and my code is exactly what you mentioned in that block. I tested it a bunch of times, and it does seem to be working now (I think I must have fixed it last night and forgotten or something). Although one weird thing happens from time to time. When I change my primary display monitor back to my actual monitor (#1), it moves my desktop icons over to the right (they're normally on the left side of my desktop, and I only have a few). I don't know if it's happening when I change to my TV (I can't see my TV from my PC, and I was too lazy to walk over there to see...I guess I should do that to find out though, huh? ), or if it's happening when I change from my TV back to my monitor. I understand why it would do that if my icons made a tall column on my desktop, because when going to the lower resolution of my TV (800x600) it has to move them, but I don't think that's it because if I remember right, the bottom of my icons did clear the bottom of the desktop/taskbar area one of the times I looked yesterday. So do you know what could be causing this? Or anyone else?
    P.S. I'm still not sure why MikeC had me enter those two loops at the bottom of my code...I don't see anything happening different...am I suppose to be looking at a log or something, or some kind of code editor/viewer? Like I said, I'm brand new to Girder.


    thanks,
    Jamie

  7. #17
    Join Date
    Jul 2005
    Location
    Uithuizen, The Netherlands
    Posts
    576

    Default

    Hi,

    repositioning of desktop icons can look inconsistent, but it usually due to do with their allignment to the invisible grid, if windows finds some are out of allignment they are automatically realligned.

    as for the log output: go to the view menu and select "interactive lua console"

    hope this helps :wink:

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •